npm 运行 build & npm start 不工作,反应应用程序
npm run build & npm start not working, react app
我是一个新的react学生,没有别的地方可以问这个问题,也不能自己解决,因为我真的很困惑,我什至不知道如何正确地把这个问题放在一起。我正在按照反应课程的说明进行操作。
我安装了 node.js,创建了一个新的项目文件夹,然后在终端中我写了 create react-app .
一切正常,然后写了 npm run build
和 npm start
,但是两者没用。
这是 npm run build
的错误消息:
> github-finder@0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder@0.1.0 build 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\liana\AppData\Roaming\npm-cache\_logs20-10-18T02_07_40_371Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder> npm run build
> github-finder@0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder@0.1.0 build 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\liana\AppData\Roaming\npm-cache\_logs20-10-18T02_10_32_763Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
下面是 npm start
的代码
> github-finder@0.1.0 start C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts start
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder@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! C:\Users\liana\AppData\Roaming\npm-cache\_logs20-10-18T02_11_45_759Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
有些消息是俄语的,如果您需要翻译,请使用翻译器或让我将翻译留在此处,无论您喜欢什么
感谢您阅读本文,我很绝望,需要帮助,互联网上还没有任何帮助我
首先根据“create-react....”创建项目
您必须使用准确的命令“npx create-react-app 'yournameProject'”
然后在文本编辑器中打开您的文件夹,例如可视化代码和 运行 以下命令 -> “npm start”
它不应该给你错误
关于你的问题:我觉得你踩了点东西
所以尝试先使用“npm i”,然后使用“npm start”
我找到了有用的东西。
使用命令节点 node node_modules/react-scripts/scripts/start.js
与 npm start
执行相同的操作,但我不知道这里有什么问题。为我工作。资料来源:https://github.com/facebook/create-react-app/issues/8221
我是一个新的react学生,没有别的地方可以问这个问题,也不能自己解决,因为我真的很困惑,我什至不知道如何正确地把这个问题放在一起。我正在按照反应课程的说明进行操作。
我安装了 node.js,创建了一个新的项目文件夹,然后在终端中我写了 create react-app .
一切正常,然后写了 npm run build
和 npm start
,但是两者没用。
这是 npm run build
的错误消息:
> github-finder@0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder@0.1.0 build 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\liana\AppData\Roaming\npm-cache\_logs20-10-18T02_07_40_371Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder> npm run build
> github-finder@0.1.0 build C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts build
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder@0.1.0 build 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\liana\AppData\Roaming\npm-cache\_logs20-10-18T02_10_32_763Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
下面是 npm start
> github-finder@0.1.0 start C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder
> react-scripts start
"Courses\github-finder\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\liana\Documents\My stuff\Webdev\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! github-finder@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the github-finder@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! C:\Users\liana\AppData\Roaming\npm-cache\_logs20-10-18T02_11_45_759Z-debug.log
PS C:\Users\liana\Documents\My stuff\Webdev\Practice Projects & Courses\github-finder>
有些消息是俄语的,如果您需要翻译,请使用翻译器或让我将翻译留在此处,无论您喜欢什么
感谢您阅读本文,我很绝望,需要帮助,互联网上还没有任何帮助我
首先根据“create-react....”创建项目 您必须使用准确的命令“npx create-react-app 'yournameProject'” 然后在文本编辑器中打开您的文件夹,例如可视化代码和 运行 以下命令 -> “npm start” 它不应该给你错误
关于你的问题:我觉得你踩了点东西
所以尝试先使用“npm i”,然后使用“npm start”
我找到了有用的东西。
使用命令节点 node node_modules/react-scripts/scripts/start.js
与 npm start
执行相同的操作,但我不知道这里有什么问题。为我工作。资料来源:https://github.com/facebook/create-react-app/issues/8221