Reactjs-演示应用程序不起作用

Vis*_*nna 14 reactjs

我正在尝试安装程序对新安装程序做出反应,但这给了我以下错误

./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'
Run Code Online (Sandbox Code Playgroud)

谁能建议我前进

提前致谢

Thu*_*mar 20

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
Run Code Online (Sandbox Code Playgroud)

After that, we have to install again

$ npm install csstools/normalize.css
Run Code Online (Sandbox Code Playgroud)

(removing sudo from the npm install command)

  • 不要使用sudo安装软件包 (11认同)