root权限:sudo
不到万不得已不要是要sudo权限
npm WARN checkPermissions Missing write access to /Users/a1/github/samplate/node_modules/anymatch/node_modulesnpm WARN enoent ENOENT: no such file or directory, open '/Users/a1/github/samplate/node_modules/_debug@4.1.1@debug/package.json'npm WARN @webpack-contrib/schema-utils@1.0.0-beta.0 requires a peer of webpack@^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.npm WARN webpack-dev-middleware@3.4.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.npm ERR! path /Users/a1/github/samplate/node_modules/_nervjs@1.3.13@nervjs/node_modules/nerv-sharednpm ERR! code ENOENTnpm ERR! errno -2npm ERR! syscall accessnpm ERR! enoent ENOENT: no such file or directory, access '/Users/a1/github/samplate/node_modules/_nervjs@1.3.13@nervjs/node_modules/nerv-shared'npm ERR! enoent This is related to npm not being able to find a file.npm ERR! enoentnpm ERR! A complete log of this run can be found in:npm ERR! /Users/a1/.npm/_logs/2019-03-25T10_37_44_630Z-debug.log
- teminal 终端出现了这个错误,警告中出现了 missing,这个是提示 root权限不允许,需要在npm 命令欠加 sudo。sudo是给予 root权限的,会车以后会出现一个 ?的密码,别担心:这个输入电脑登录密码就好,输入的时候屏 幕上不会出现几位数,是为了防止别人看到几位数来破解,输入密码后回车就好。
下面出现了一个 no such file or directory, access ‘/Users/a1/github/samplate/node_modules/_nervjs@1.3.13@nervjs/node_modules/nerv-shared’
这是少了什么包,下载那个缺失的包就好。输入 sudo npm install nerv-shared 就好,然后再运行sudo npm i ,继续 sudo npm i taro-ui - S ,继续往下进行。
由于本次在npm的解决问题上使用了 cnpm 的install插曲, 所以需要 执行 cnpm i 的全部下载操作,然后再进行 sudo npm i /sudo npm i taro-ui -S 操作。cnpm需要翻墙。
- 开发环境搭建的时候不需要翻墙,翻墙会下载很多不需要的东西,速度会很慢,下载的时候如果翻墙了中途不能中断,会出现很多问题,最好搭建的时候不要翻墙。
npm -vnode -vvi /Users/a1/.npm/_logs/2019-03-25T12_19_59_370Z-debug.logls -la /Users/a1/github/samplate/node_modules/_@tarojs_async-await@1.2.21@@tarojs/async-await/node_modules/ls -la /Users/a1/github/samplate/node_modules/_@tarojs_async-await@1.2.21@@tarojs/async-await/node_modulels -la /Users/a1/github/samplate/node_modules/_@tarojs_async-await@1.2.21@@tarojs/async-await/node_modulesls -la /Users/a1/github/samplate/node_modules/_@tarojs_async-await@1.2.21@@tarojs/async-await/node_modulesnpm icat package.json:qlscat project.config.jsonls -la config/ls -la config/index.jscat config/index.jscat ~/.npmrchistory | grep npmcnpm isudo rm -rf node_modulescnpm i
