汇合"Hello World"宏帮助 - NPM 安装/启动不起作用



我正在尝试制作我的第一个汇合宏,我正在按照此处列出的说明进行操作:https://developer.atlassian.com/cloud/confluence/getting-started/?_ga=2.78735767.2027190294.1547046060-2004234667.1546438516

目前,我在执行步骤 2 和 4 时遇到问题;NPM 安装和 NPM 启动:

收到以下错误:

➜  ~ cd confluence_app
➜  confluence_app 
➜  confluence_app ls
confluence-helloworld-addon credentials.json            package-lock.json
➜  confluence_app ls
confluence-helloworld-addon
➜  confluence_app cd confluence-helloworld-addon
➜  confluence-helloworld-addon git:(master) npm install package.json 
npm notice created a lockfile as package-lock.json. You should commit this file.
+ package.json@2.0.1
added 74 packages from 35 contributors and audited 162 packages in 29.12s
found 0 vulnerabilities
➜  confluence-helloworld-addon git:(master) ✗ npm start               
> helloworld-addon@0.0.1 start /Users/serdarmustafa/confluence_app/confluence-helloworld-addon
> node app.js
internal/modules/cjs/loader.js:583
    throw err;
    ^
Error: Cannot find module 'express'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/serdarmustafa/confluence_app/confluence-helloworld-addon/app.js:6:15)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! helloworld-addon@0.0.1 start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the helloworld-addon@0.0.1 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!     /Users/serdarmustafa/.npm/_logs/2019-01-12T09_26_18_269Z-debug.log

先运行npm cache clean --force,然后运行npm install,然后运行npm start

这应该可以解决它。

--或者删除node_modules文件夹并重新运行npm install

--或1. npm 缓存清理 --强制

  1. 删除node_modulespackage-lock.json

  2. npm 安装

最新更新