F:\COMPUTER\miniprogram>npm install
A complete log of this run can be fund in: C\Users\用户\AppData\Roaming\npm-cache_logs
——解决办法:重新创建新的文件夹miniprogram
F:\COMPUTER\miniprogram>npm init
This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults.
See npm help init for definitive documentation on these fields and exactly what they do.
Use npm install <pkg> afterwards to install a package and save it as a dependency in the package.json file.
Press ^C at any time to quit.
——解决办法:改用指令npm init -y
F:\COMPUTER\miniprogram>npm init -y
F:\COMPUTER\miniprogram>npm install
npm WARN miniprogram@1.0.0 No description npm WARN miniprogram@1.0.0 No repository field.
——解决办法:package.json文件添加字段:“private”: “true”,
F:\COMPUTER\miniprogram>npm install
up to date in 0.33s ——成功解决npm install问题
工具-构建npm
Error: F:\COMPUTER\miniprogram\package.json 对应的 node_modules 不存在,请在 F:\COMPUTER\miniprogram 执行 npm install
——解决办法:F:\COMPUTER\miniprogram>npm i @vant/weapp -S --production
此时项目生成node_modules文件,这时再进行工具-构建npm,成功!
附整个成功构建的流程:
创建新的文件夹miniprogram
F:\COMPUTER\miniprogram>npm init -y
package.json文件添加字段:"private": "true",
F:\COMPUTER\miniprogram>npm install
F:\COMPUTER\miniprogram>npm i @vant/weapp -S --production
此时项目生成node_modules文件,这时再进行工具-构建npm,系统提示构建完成,
并生成新的文件夹miniprogram_npm,代表构建成功。
|