NativeScript / nativescript-plugin-seed

Get started building NativeScript plugins quickly.
Apache License 2.0
102 stars 54 forks source link

Running `npm run postclone` fails #180

Open dahjelle opened 4 years ago

dahjelle commented 4 years ago

Which platform(s) does your issue occur on?

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

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

As per the instructions:

But I get the following output:

% npm run postclone

> nativescript-yourplugin@1.0.0 postclone /Users/dahjelle/Downloads/mobile-test/nativescript-yourplugin/src
> npm i && node scripts/postclone.js

> @nativescript/core@6.5.20 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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 nativescript@6.8.0

Then the installation script will work properly.

theGeekyLad commented 4 years ago

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