Tag Archives: : No such file or directory

npm run build : No such file or directory [How to Solve]

Phenomenon

React project, npm run build uses babel with browserify, as follows.

babel --presets es2015,react js/source -d js/build
browserify js/build/index.js -o bundle.js

Run error:

/bin/sh: /c/Users/xxx/AppData/Local/Yarn/bin/../Data/global/node_modules/.bin/babel: No such file or directory
/bin/sh: /c/Users/xxx/AppData/Local/Yarn/bin/../Data/global/node_modules/.bin/browserify: No such file or directory

Settle

Access C:/users/xxx/appdata/local/Yan/data/global/node in the folder directory_Modules /. Bin/, there is only one serve in this folder:

the required Babel and Browse (the specific reason has not been found)
since it is missing, Re yarn add :

yarn global add babel
yarn global add browserify

However, in the process of packaging yarn global add Babel , the following errors are reported:

error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\Users\\xxx\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\.bin\\serve'".

Solution please go to another essay on this site: Yan add package error: operation not allowed, unlink