简体   繁体   English

使用Plugman生成package.json时出错

[英]Error generating package.json with Plugman

I'm trying to build my custom cordova plugin following these steps . 我正在尝试按照以下步骤构建自定义的cordova插件。 After running the command plugman createpackagejson . 运行命令plugman createpackagejson . from the folder where the plugin is located in, I get this error: 从插件所在的文件夹中,出现以下错误:

C:\Users\[UserName]\AppData\Roaming\npm\node_modules\plugman\node_modules\cordova-lib\node_modules\init-package-json\node_modules\read-package-json\node_modules\json-parse-better-errors\index.js:9
const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i)
^^^^^
Use of const in strict mode.

Any suggestion? 有什么建议吗?

I just faced this issue and it looks like it is because of an older version of node.js. 我只是遇到了这个问题,它看起来是因为node.js的版本较旧。 It looks like you are on Windows so check here for info on upgrading. 您似乎在Windows上,因此请在此处查看有关升级的信息。 https://www.npmjs.com/package/npm-windows-upgrade I ended up having to uninstall and reinstall Node to get it working as I could not get the upgrade to work. https://www.npmjs.com/package/npm-windows-upgrade我最终不得不卸载并重新安装Node才能使其正常运行,因为升级无法正常进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM