问题描述
我正在尝试在一个我很久没有参与过的 React 项目上启动开发服务器.在运行 npm install
和 npm start
时,我收到了标题错误消息.
我尝试手动更新然后降级 Node-sass,但无论我做什么,我仍然遇到相同的错误.这是我收到的完整错误消息.
I am trying to start the development server on a React project that I have not worked on for a long time. Upon running npm install
and npm start
I received the title error message.
I tried manually updating and then downgrading the Node-sass but I am still getting the same error no matter what I do.Here is the full error message I am getting.
Failed to compile.
./src/App.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/App.scss)
Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.
/home/dylan/Desktop/Werk/Professional stuff/SkylimitHost/node_modules/react-scripts/scripts/start.js:19
throw err;
^
[Error: ENOENT: no such file or directory, stat '/home/dylan/.steampath'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/dylan/.steampath'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cleanapp@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cleanapp@0.1.0 start 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! /home/dylan/.npm/_logs/2020-11-23T05_19_03_778Z-debug.log
这是完整的日志
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/dylan/.nvm/versions/node/v14.15.0/bin/node',
1 verbose cli '/home/dylan/.nvm/versions/node/v14.15.0/bin/npm',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v14.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle cleanapp@0.1.0~prestart: cleanapp@0.1.0
6 info lifecycle cleanapp@0.1.0~start: cleanapp@0.1.0
7 verbose lifecycle cleanapp@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle cleanapp@0.1.0~start: PATH: /home/dylan/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/dylan/Desktop/Werk/Professional stuff/SkylimitHost/node_modules/.bin:/home/dylan/.nvm/versions/node/v14.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle cleanapp@0.1.0~start: CWD: /home/dylan/Desktop/Werk/Professional stuff/SkylimitHost
10 silly lifecycle cleanapp@0.1.0~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle cleanapp@0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle cleanapp@0.1.0~start: Failed to exec start script
13 verbose stack Error: cleanapp@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/home/dylan/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (/home/dylan/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid cleanapp@0.1.0
15 verbose cwd /home/dylan/Desktop/Werk/Professional stuff/SkylimitHost
16 verbose Linux 5.4.0-53-generic
17 verbose argv "/home/dylan/.nvm/versions/node/v14.15.0/bin/node" "/home/dylan/.nvm/versions/node/v14.15.0/bin/npm" "start"
18 verbose node v14.15.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error cleanapp@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the cleanapp@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
我不明白为什么我的服务器无法启动,任何帮助将不胜感激.
I don't understand why my server won't start, any help would be appreciated.
推荐答案
我已经找到了解决方案.此错误只是一个花哨/令人费解的缺少依赖项消息.如果您安装了项目所需的所有依赖项(有些可能不在 package.json 文件中),它应该可以正常工作.
I've found out the solution. This error is just a fancy/convoluted missing dependencies message. If you install all the dependencies the project needs (some might not be in the package.json file) it should work correctly.
这篇关于错误:ENOENT:没有这样的文件或目录,stat ... .steampath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!