Skip to content
New issue

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

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

Already on GitHub? # to your account

npm run command can't find file? #782

Closed
f0rr0 opened this issue Oct 12, 2016 · 7 comments
Closed

npm run command can't find file? #782

f0rr0 opened this issue Oct 12, 2016 · 7 comments

Comments

@f0rr0
Copy link

f0rr0 commented Oct 12, 2016

Do you want to request a feature or report a bug?
bug

What is the current behavior?

yarn run start
yarn run v0.15.1
$ "$(npm bin)/babel-node scripts/start.js"
sh: /Users/...path.../node_modules/.bin/babel-node scripts/start.js: No such file or directory
error Command failed with exit code 127.

If the current behavior is a bug, please provide the steps to reproduce.

"scripts": {
"start" : "$(npm bin)/babel-node scripts/start.js"
}

What is the expected behavior?
The script should be found since it exists. npm run start handles this as expected.

Please mention your node.js, yarn and operating system version.
Node - v6.7.0
yarn - v0.15.1
OS - osx 10.10.5

@FLGMwt
Copy link
Contributor

FLGMwt commented Oct 12, 2016

I think you'll be fine without the $(npm bin)/ and just "start": "babel-node scripts/start.js" since yarn run includes the .bin of the working project (https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/run.js#L35)

Additionally, the idea is to use the npm cli or yarn as they're serving the same purpose : )

@f0rr0
Copy link
Author

f0rr0 commented Oct 12, 2016

@FLGMwt I get the same error after removing bin. Also can't fathom why removing bin would change anything since it is inside $()

@nodesocket
Copy link

nodesocket commented Oct 12, 2016

I confirm as well. A direct port of npm to yarn breaks:

"scripts": {
    "dev": "webpack-dev-server --progress --colors --port 9090"
}

yarn run dev errors with:

No such file or directory
error Command failed with exit code 127.

Node: 6.5.0
Yarn: 0.15.1
OS: macOS 10.12

@notahat
Copy link

notahat commented Oct 12, 2016

See #733. I think this is the same problem.

@f0rr0
Copy link
Author

f0rr0 commented Oct 12, 2016

"start": "pwd" works. But "start": "echo 'stuff'" fails. This validates #733 (comment)

@dmfutcher
Copy link

This is fixed in current master branch (see #809)

@sebmck
Copy link
Contributor

sebmck commented Oct 15, 2016

Fixed via #809.

@sebmck sebmck closed this as completed Oct 15, 2016
@wyze wyze removed the needs triage label Nov 10, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants