You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
For example I have a project which installed a babel-cli locally, and added a script entry in the package.json to run babel by npm run, then I cd to a sub-folder(i.e. /foo/ folder) of my project and run npm run babel a.jsx -o a.js, the script will fail by not found the file a.jsx.
I should run the command npm run foo/a.jsx -o foo/a.js for the right behavior.
Which means npm run sets the cwd to the project root path but not the path which running the command, I think that is not an expected behavior, cause git(or most other command) will setting the correct cwd when you run git command in sub-folder of a repo:
/foo/ > git add a.js will work, not need to run git add foo/a.js(and in fact this command will fail)
For example I have a project which installed a
babel-clilocally, and added ascriptentry in thepackage.jsonto runbabelbynpm run, then Icdto a sub-folder(i.e./foo/folder) of my project and runnpm run babel a.jsx -o a.js, the script will fail by not found the filea.jsx.I should run the command
npm run foo/a.jsx -o foo/a.jsfor the right behavior.Which means
npm runsets thecwdto the project root path but not the path which running the command, I think that is not an expected behavior, cause git(or most other command) will setting the correctcwdwhen you run git command in sub-folder of a repo:/foo/ >
git add a.jswill work, not need to rungit add foo/a.js(and in fact this command will fail)