I have the problem that I can only run my npm scripts f.e. npm run dev
or npm run build
when my folder sits on the Desktop. As soon as I try to put the folder into my folder structure, it throws the following error:
npm run dev
> react-course@1.0.0 dev C:\Users\dhaas\Documents\Web development\JS & react projekte\petfinder
> parcel src/index.html
Der Befehl "react" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
internal/modules/cjs/loader.js:796
throw err;
^
Error: Cannot find module 'C:\Users\dhaas\Documents\Web development\parcel-bundler\bin\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
at Function.Module._load (internal/modules/cjs/loader.js:686:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-course@1.0.0 dev: `parcel src/index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-course@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dhaas\AppData\Roaming\npm-cache\_logs\2020-04-07T09_06_17_441Z-debug.log
This problem occurs with parcel and webpack. Installing npm globally and reinstalling the packags locally wasn't the solution.
Thank you for you help!