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 script ` "lint": "standard"` from `linting` folder doesn't find standard in ../node_modules/bin #901

Closed
QuantumInformation opened this issue May 30, 2017 · 10 comments

Comments

@QuantumInformation
Copy link

commented May 30, 2017

Just gives me:

➜  linting git:(master) ✗ npm run standard
npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/nikos/.nvm/versions/node/v7.8.0/bin/node" "/Users/nikos/.nvm/versions/node/v7.8.0/bin/npm" "run" "standard"
npm ERR! node v7.8.0
npm ERR! npm  v4.2.0

npm ERR! missing script: standard

image

@Flet

This comment has been minimized.

Copy link
Member

commented May 30, 2017

missing script: standard is an error from npm.
It means the script named standard has not been defined in package.json.

Can you check package.json to see if its defined?

@QuantumInformation

This comment has been minimized.

Copy link
Author

commented May 30, 2017

standard is defined in the parent package.json. I am wanting to avoid running npm i in the current dir.

@QuantumInformation

This comment has been minimized.

Copy link
Author

commented May 31, 2017

Adding standard as a dep also doesn't work

@QuantumInformation QuantumInformation changed the title Running npm script `standard` from `linting` folder doesn't find standard in ../node_modules/bin Running npm script ` "lint": "standard"` from `linting` folder doesn't find standard in ../node_modules/bin May 31, 2017

@QuantumInformation

This comment has been minimized.

Copy link
Author

commented May 31, 2017

image

@LinusU

This comment has been minimized.

Copy link
Member

commented May 31, 2017

You have defined a script called lint, if you run npm run lint instead of npm run standard it should work

@QuantumInformation

This comment has been minimized.

Copy link
Author

commented May 31, 2017

npm run lint

standard

sh: standard: command not found

@LinusU

This comment has been minimized.

Copy link
Member

commented May 31, 2017

Have you run npm install?

@QuantumInformation

This comment has been minimized.

Copy link
Author

commented May 31, 2017

Only in the parent dir, wanting to avoid the user running npm i, in the local dir.

Just want one standard install at the route of the project.

@LinusU

This comment has been minimized.

Copy link
Member

commented May 31, 2017

Aha, npm only appends ./node_modules/.bin/ to the PATH but since your binaries are placed at a directory higher that wont work... I think that you'll have to hardcode the path in the script, "lint": "../node_modules/.bin/standard" or install standard globally (npm install -g standard)

@feross

This comment has been minimized.

Copy link
Member

commented Jun 21, 2017

Yep, @LinusU is correct! I'll close this now, as it's not an issue with standard.

@feross feross closed this Jun 21, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.