Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running npm run postclone fails #180

Open
dahjelle opened this issue Sep 28, 2020 · 7 comments
Open

Running npm run postclone fails #180

dahjelle opened this issue Sep 28, 2020 · 7 comments

Comments

@dahjelle
Copy link

Which platform(s) does your issue occur on?

  • installation using macOS

Please, provide the following version numbers that your issue occurs with:

  • CLI: 7.0.8
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

Please, tell us how to recreate the issue in as much detail as possible.

As per the instructions:

  • git clone https://github.com/NativeScript/nativescript-plugin-seed nativescript-yourplugin
  • cd nativescript-yourplugin/src
  • npm run postclone

But I get the following output:

% npm run postclone

> [email protected] postclone /Users/dahjelle/Downloads/mobile-test/nativescript-yourplugin/src
> npm i && node scripts/postclone.js


> @nativescript/[email protected] postinstall /Users/dahjelle/Downloads/mobile-test/nativescript-yourplugin/src/node_modules/@nativescript/core
> node cli-hooks/postinstall.js

npm notice created a lockfile as package-lock.json. You should commit this file.
added 71 packages from 76 contributors in 8.902s

2 packages are looking for funding
  run `npm fund` for details

NativeScript Plugin Seed Configuration
prompt: What is your GitHub username (used for updating package.json)? Example: NathanWalker:  (node:74431) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
dahjelle
prompt: What will be the name of your plugin? Use lowercase characters and dashes only. Example: yourplugin / google-maps / bluetooth:  yourplugin
Using Yourplugin as the TypeScript Class name..
Will now rename some files..
prompt: Do you want to include a "TypeScript NativeScript" application linked with your plugin to make development easier (y/n)?:  (y)
prompt: Do you want to include an "Angular NativeScript" application linked with your plugin to make development easier (y/n)?:  (n)
Creating 'TypeScript' application from latest published template...
You are using the deprecated nsconfig.json file. Just be aware that NativeScript 7 has an improved nativescript.config.(js|ts) file for when you're ready to upgrade this project.
The "path" argument must be of type string. Received null
TypeScript-NativeScript application created at: ../demo
Adjusting scripts..
Installing plugin to ../demo ...
Error: Command failed: cd ../demo && tns plugin add ../src
/bin/sh: line 0: cd: ../demo: No such file or directory

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1047:16)
    at Socket.<anonymous> (internal/child_process.js:438:11)
    at Socket.emit (events.js:314:20)
    at Pipe.<anonymous> (net.js:672:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'cd ../demo && tns plugin add ../src'
}

I'm brand-new to NativeScript — is this related to #179 ?

@dahjelle
Copy link
Author

If I'm not mistaken, there is the same/a similar issue with the CI builds: https://travis-ci.org/github/NativeScript/nativescript-plugin-seed/jobs/730818948

@dahjelle
Copy link
Author

I ended up here from the https://docs.nativescript.org/plugins/building-plugins#the-nativescript-plugin-seed page — but, now that I see the recent blog post, I wonder if this is out-of-date as compared to https://github.com/nativescript/plugin-seed/ ?

@theGeekyLad
Copy link

Been facing exactly what you've describe above @dahjelle . I too arrived here from the same link. Did you manage to fix it with the newer one?

@dahjelle
Copy link
Author

Been facing exactly what you've describe above @dahjelle . I too arrived here from the same link. Did you manage to fix it with the newer one?

@theGeekyLad No, I ended up just using an empty directory and then putting contents in it based off of the NativeScript plugin reference. That's worked well for me. I'm not sure what I may or may not be missing from the plugin seed — perhaps some recommended dependencies or a sample app? But, for my purpose — building a plugin simply to add a native library to my app, not a plugin to distribute by itself — it's worked well.

@theGeekyLad
Copy link

I dropped a line on their Slack channel just to know if there's a way out. Looks like this repo, what the documentation details so vividly, is indeed outdated. The newer seed repo is the thing though I don't see good hand-holding on how to go about with it.

For now, I just picked up a simple open source plugin from their marketplace as a starter and made my way through it. Guess someone's gotta shed some more light on / update the documentation.

@jfturcot
Copy link

I figured the problem here, this plugin seed has been deprecated with NS7. If wish to create a plugin for 7, you really should be using the new seed. In my case, I had to create a plugin for a project that is not yet ready to be upgraded to 7.

If you wish to develop a plugin for 6 and you want to use this seed properly you'll need to downgrade your CLI to 6.8.0:

npm install -g [email protected]

Then the installation script will work properly.

@theGeekyLad
Copy link

Oh thanks for your thoughts @jfturcot , I'll try downgrading the CLI for a start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants