I am currently learning react, and started a new app with create-react-app.
I navigated into the new app, then ran npm start.
I got this error message:
Error: Cannot find module '~/Desktop/forms-test/node_modules/postcss-safe-parser/node_modules/postcss/lib/tokenize'
at createEsmNotFoundErr (internal/modules/cjs/loader.js:907:15)
at finalizeEsmResolution (internal/modules/cjs/loader.js:900:15)
at resolveExports (internal/modules/cjs/loader.js:432:14)
at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (~/Desktop/forms-test/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
Any help would be very useful.
I am running Mac OS Catalina, using npm, and running zsh. I am using node version 14.13.1
For others digging around, I followed the instructions on this answer.
rm yarn.lock
yarn install
And that reinstalled everything and properly exported the lib/tokenize path inside of node_modules/postcss-safe-parser/node_modules/postcss/package.json.
Related
`C:\Users\92311\Videos\demo>npm run dev
> demo#4.0.0 dev
> vite
failed to load config from C:\Users\92311\Videos\demo\vite.config.ts
error when starting dev server:
Error: ENOENT: no such file or directory, scandir 'C:\Users\92311\packages'
at Object.readdirSync (node:fs:1072:3)
at Object.<anonymous> (C:\Users\92311\Videos\demo\vite.config.ts:37:34)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object._require.extensions.<computed> [as .js] (file:///C:/Users/92311/Videos/demo/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:63154:24)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Function.Module._load (node:internal/modules/cjs/loader:828:14)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:93:18)
at loadConfigFromBundledFile (file:///C:/Users/92311/Videos/demo/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:63162:21)
at loadConfigFromFile (file:///C:/Users/92311/Videos/demo/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:63020:34)
`
When i pull the demo from react-admin repo and After install dev dependencies and hit npm run dev i found this error im expecting to start
OS:Windows 11
NodeVersion : 14.10.0 (also tried till with latest version also).
So make commands is not working in windows for me what i did is
yarn install
on main/ root directory after that goes into each packages folder and run
yarn build
this what a make file do when you run make install or make build.
after that is run yarn run-demo and my project has been up! 🐟
i try to run an angularjs applic, i understood that max version of node that can run it is 6.17.1
so i downloaded it using nvm, and then i run npm install but when i run npm start it failse and it looks like it downloade dependencis of higher versions that use es6 so thats why it fails.
i tried to downgrade specific libraries by deleting them from node modules and installing again specific lower version but when i tried npm show version it looks like its still use the higher version.
the error message is:
Failed to load external module #babel/register
[08:42:09] Requiring external module babel-register
C:\Users\s313240798\source\Workspaces\Nesher\Nesher\Nesher.Client\node_modules\micromatch\index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Module._extensions..js (module.js:586:10)
at Object.require.extensions.(anonymous function) [as .js] (C:\Users\s313240798\source\Workspaces\Nesher\Nesher\Nesher.Client\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
i tried to run it also with higher version of node but then the app was on but faild because of th e Incompatibility of versions
This page has some suggestions which may help fix your issue: github.com/gulpjs/gulp/issues/1631
Have you tried this suggestion from the above web page?
npm i -S babel-register
Here is the error I am getting when I enter npm start:
internal/modules/cjs/loader.js:905
throw err;
Error: Cannot find module 'C:\Users\react-scripts\bin\react-scripts.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executelserEntryPoint (as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
I tried reinstalling my React project but it did not fix my error.
If you have an & in your project's path you will run into this issue, at least on Windows it seems like. The part in the path after the & is interpreted as another command as per the error and everything breaks from there.
So create the project out of Users folder in your case and where H&K should be not be the path.
Confirming that as soon as it's removed, npm start works fine.
I'm trying to debug my app. In the past everything worked perfectly. Then I formatted the computer, downloaded the project I had saved from git.
At this point, every time I try to run npm start in the terminal or to use the react native tool of visual studio code to debug the app or in any case to update the app connected to my device I get this error:
Error: Cannot find module '/Users/..../node_modules/#react-native-community/cli/build/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:338:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:719:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1072:27)
at Function.Module._load (internal/modules/cjs/loader.js:928:27)
at Module.require (internal/modules/cjs/loader.js:1145:19)
at require (internal/modules/cjs/helpers.js:75:18)
at Object.<anonymous> (/Users/.../node_modules/react-native/cli.js:12:11)
at Module._compile (internal/modules/cjs/loader.js:1256:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
at Module.load (internal/modules/cjs/loader.js:1105:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/..../node_modules/#react-native-community/cli/package.json',
requestPath: '#react-native-community/cli'
I don't understand how can I do.
I remember that before when I made a change to the code I just needed to run npm start to reload my project and see the changes in my device. Now I absolutely can't get the code and device to interact.
How can I do?
You try reinstall React LI:
npm install –g react-native-cli
and install dependences:
npm install
I am new to react and am trying to start a basic react webapp following this "Getting Started" tutorial.
npx create-react-app first_react_app
cd first_react_app
npm start
Unfortunately I am getting the following error when starting the app.
C:\Users\user\Desktop\Lernprojekte\React\first_react_app\node_modules\react-dev-utils\WebpackDevServerUtils.js:166
compiler.hooks.done.tap('done', async stats => {
^^^^^
SyntaxError: missing ) after argument list
at Object.exports.runInThisContext (vm.js:78:16)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\user\Desktop\Lernprojekte\React\first_react_app\node_modules\react-scripts\scripts\start.js:45:5)
at Module._compile (module.js:571:32)
I read that async/await is not compatible with some lower versions of node.
I am using node 9.8.0 and npm 6.9.0 in windows 10.
I even deleted the node_modules and npm install again but still getting the same error.
As mentioned in this docs: Try this
npm run build
then
npm run start
If you follow react tutorials(react basic tutorial), you should see quick start commands and try to run these commands.
npx create-react-app first_react_app
cd first_react_app
npm start
and make sure your system has preinstalled npm to start with react.
Or you need to update your dev server file to remove this syntax error.
go to file in your project React\first_react_app\node_modules\react-dev-utils\WebpackDevServerUtils.js
go to line no 145 and Update given code.Save this file and restart your server.
compiler.hooks.done.tap('done', stats => {
if (isInteractive) {
clearConsole();
}
i came across the same problem, and although i upgraded npm & node to the latest versions, they were NOT the most updated in the directory of the react-app that I created.
solution: go to the directory of your react-app and upgrade npm & node
nvm install --latest-npm
Looks like your node.js version is outdated. You can update to the latest one or you can configure multiple node.js versions simultaneously. I am using 'n' a node version manager, so, that I can switch back and forth easily for managing multiple projects. You can read about this in the following link:
n
You can install it like this:
> npm install -g n #install utility globally
> n 10.16.0 #install the version you want
> n #switch back and forth to node.js versions
To know more about the node.js LTS version visit here:
node-release