Reputation: 1305
I am trying setup react new setup but it is give me below error
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
Error: Cannot find module '@csstools/normalize.css'
can anyone suggest me to move forward
thanks in advance
Upvotes: 15
Views: 8436
Reputation: 433
I'm able to solve the problem. The problem is that package-lock.json
is pointing to the older packages.
To fix, uninstall an install the package again
Uninstall package
$ sudo npm remove csstools/normalize.css
After that, we have to install again
$ npm install csstools/normalize.css
(removing sudo from the npm install command)
Upvotes: 21
Reputation: 71
fixed issue by updating npm to latest version.
sudo npm install npm@latest -g
Upvotes: 0
Reputation: 10226
This worked for me (unfortunately a really annoying solution since it gets wiped whenever node_modules gets reinstalled), when recreating with npx create-react-app
did not work.
Go to react-app/node_modules/@csstools
Change the name of the normalize.css folder into something else (ex. anormalize.css)
Take the files from the folder and paste them into the @csstools folder
Delete the anormalize.css folder
Upvotes: 0
Reputation: 1
If you're getting this error, chances are that you haven't used npx
to create the react app. You must have used -
create-react-app project_name
Delete the project folder and reinstall it using -
npx create-react-app project_name
It should work this time. npx
is a tool for node packages, which also installs some third party packages that running create-react-app
alone might not install, hence throws the error.
Upvotes: -1
Reputation: 443
I solve the same problem. The problem is that package-lock.json is pointing to the older packages. Not sure which package is but needs to be updated. The gist is that, you create a fresh reactapp, use your "package.json" to recreate "package-lock.json", and move it over back to your project. Do it AFTER you update the npm and clear the cache. Unfortunately, I didn't keep the exact sequence as I was trying to solve, following steps should be pretty close to what I did.
$ sudo npm cache clear --force
$ sudo npm install -g npm
$ cd <MYREACTAPPDIR>
$ npm install react@latest --save
$ cd ..
$ npx create-react-app tempapp
$ cp <MYREACTAPPDIR>/package.json tempapp/package.json
$ cd tempapp
$ npm install
$ cp package-lock.json ../<MYREACTAPPDIR>
$ cd ../<MYREACTAPPDIR>
$ rm -fr node_modules
$ npm install
$ npm run build
Upvotes: 0
Reputation: 21
rm -rf node_modules
npm cache clean --force
npm install
now try again to run your scripts, it should work
https://github.com/react-toolbox/react-toolbox-example/issues/28
Upvotes: 1