sezna / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
MIT License
1.43k stars 93 forks source link

5.9.10 (or 5.9.9) is not executable #213

Closed Vages closed 4 years ago

Vages commented 4 years ago

The command executed:

npm

➜  ~ mkdir foo
➜  ~ cd foo
➜  foo npm init # Auto accepted all choices; blank project
➜  foo npm install -D nps

yarn

➜  ~ mkdir foo
➜  ~ cd foo
➜  foo yarn init
➜  foo yarn add -D nps
➜  foo yarn nps 
➜  foo ./node_modules/.bin/nps

The output: npm

npm WARN foo@1.0.0 No description
npm WARN foo@1.0.0 No repository field.

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path ~/foo/node_modules/nps/dist/bin/nps.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '~/foo/node_modules/nps/dist/bin/nps.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2019-12-07T07_25_48_439Z-debug.log

yarn

➜  foo yarn add -D nps
yarn add v1.19.2
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Saved lockfile.
success Saved 51 new dependencies.
info Direct dependencies
└─ nps@5.9.10
info All dependencies
├─ ansi-regex@4.1.0
├─ ansi-styles@3.2.1
├─ argparse@1.0.10
├─ arrify@1.0.1
├─ camelcase@5.3.1
├─ chalk@2.4.2
├─ cliui@5.0.0
├─ color-convert@1.9.3
├─ color-name@1.1.3
├─ common-tags@1.8.0
├─ emoji-regex@7.0.3
├─ escape-string-regexp@1.0.5
├─ esprima@4.0.1
├─ event-stream@3.3.4
├─ find-up@2.1.0
├─ from@0.1.7
├─ get-caller-file@2.0.5
├─ has-flag@3.0.0
├─ is-fullwidth-code-point@2.0.0
├─ is-object@1.0.1
├─ js-yaml@3.13.1
├─ locate-path@2.0.0
├─ lodash@4.17.15
├─ manage-path@2.0.0
├─ map-stream@0.1.0
├─ nps@5.9.10
├─ p-limit@1.3.0
├─ p-locate@2.0.0
├─ p-try@1.0.0
├─ pause-stream@0.0.11
├─ prefix-matches@1.0.1
├─ ps-tree@1.2.0
├─ readline-sync@1.4.10
├─ require-directory@2.1.1
├─ require-main-filename@2.0.0
├─ set-blocking@2.0.0
├─ spawn-command-with-kill@1.0.2
├─ spawn-command@0.0.2-1
├─ split@0.3.3
├─ sprintf-js@1.0.3
├─ starts-with@1.0.2
├─ stream-combiner@0.0.4
├─ strip-ansi@5.2.0
├─ supports-color@5.5.0
├─ through@2.3.8
├─ type-detect@4.0.8
├─ which-module@2.0.0
├─ wrap-ansi@5.1.0
├─ y18n@4.0.0
├─ yargs-parser@15.0.0
└─ yargs@14.2.0
✨  Done in 1.56s.

➜  foo yarn nps 
yarn run v1.19.2
error Command "nps" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

➜  foo ./node_modules/.bin/nps
zsh: no such file or directory: ./node_modules/.bin/nps

Problem description: nps version 5.9.10 (or 5.9.9) is not executable, because no nps script is added to node_modules/.bin.

The problem appears somewhat differently with yarn and npm. With yarn, the install succeeds, but no package can be found. With npm, things fail already on install.

Suggested solution: Roll back and find error. I have tried looking through the recent commits, but I can't immediately find anything that caused this.

Vages commented 4 years ago

Note that the versions have diverged on Github and npm

sezna commented 4 years ago

Alright, I’m taking a look now. I don’t think it is tied to the version mismatch, as things were mismatched before. It might have to do with the travis deployment change.

MUTOgen commented 4 years ago

I have the same issue Can't install nps globally

npm install --global nps
npm ERR! path /Users/antonmac/.nvm/versions/node/v10.16.3/lib/node_modules/nps/dist/bin/nps.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/antonmac/.nvm/versions/node/v10.16.3/lib/node_modules/nps/dist/bin/nps.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/antonmac/.npm/_logs/2019-12-07T17_55_01_292Z-debug.log
sezna commented 4 years ago

All fixed up. New synced-up version is v5.9.12.