Мих*_*кий 3 javascript windows android npm react-native
我想下载并运行别人的项目,以考虑其功能。我遇到了许多问题......它并不适合开始,我只是不知道该怎么做,请帮助
1)复制到工作文件夹教程项目
2)打开VS代码
3)进入工作文件夹,在cmd文件夹教程项目中点击打开
4)然后我进入react-native run-android
并获得惨败
d:\JS\tutorialProject>react-native init tutorialProject
internal/modules/cjs/loader.js:657 throw err; ^
Error: Cannot find module 'graceful-fs' at
Function.Module._resolveFilename
(internal/modules/cjs/loader.js:655:15) at Function.Module._load
(internal/modules/cjs/loader.js:580:25) at Module.require
(internal/modules/cjs/loader.js:711:19) at require
(internal/modules/cjs/helpers.js:14:16) at Object.<anonymous>
(d:\JS\tutorialProject\node_modules\react-native\local-cli\cli.js:12:1)
at Module._compile (internal/modules/cjs/loader.js:805:30) at
Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
at Module.load (internal/modules/cjs/loader.js:672:32) at
tryModuleLoad (internal/modules/cjs/loader.js:612:12) at
Function.Module._load (internal/modules/cjs/loader.js:604:3)
Run Code Online (Sandbox Code Playgroud)
我开始使用谷歌搜索,发现与一些依赖关系有关。使用react-native init MyProject
5)react-native init tutorialProject并获得更紧的正确路线
我尝试通过启动服务器npm,然后这很有趣...... 6)npm-intall
d:\JS\tutorialProject>npm install npm WARN deprecated core-js@1.2.7:
core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3
or at least to actual version of core-js@2. npm WARN deprecated
connect@2.30.2: connect 2.x series is deprecated npm ERR! path
d:\JS\tutorialProject\node_modules\.bin\react-native npm ERR! code
EEXIST npm ERR! Refusing to delete
d:\JS\tutorialProject\node_modules\.bin\react-native: is outside
d:\JS\tutorialProject\node_modules\react-native and not a link npm
ERR! File exists: d:\JS\tutorialProject\node_modules\.bin\react-native
npm ERR! Move it away, and try again.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Nick\AppData\Roaming\npm-cache\_logs\2019-04-16T18_15_13_614Z-debug.log
Run Code Online (Sandbox Code Playgroud)
在这里我绝对不知道。如何运行别人的项目?
下载后需要安装所有的包 package.json
npm install --save
Run Code Online (Sandbox Code Playgroud)
然后你需要启动另一个终端
npm start -- --reset-cache / npm start / react-native start
Run Code Online (Sandbox Code Playgroud)
它用于启动您的打包程序
最后你可以运行你的项目
react-native run-android
Run Code Online (Sandbox Code Playgroud)
在安装了节点的计算机上,您可以通过命令行导航到项目文件夹的根目录。
然后安装依赖项:
npm i
这将安装项目需要构建的所有库
然后运行项目构建脚本。这是在项目 package.json 文件中定义的。在该项目的情况下,脚本称为启动。所以:
npm run start
| 归档时间: |
|
| 查看次数: |
14845 次 |
| 最近记录: |