Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎样在服务器ubuntu 16.4上运行 #61

Open
hebaoying opened this issue Dec 14, 2018 · 2 comments
Open

怎样在服务器ubuntu 16.4上运行 #61

hebaoying opened this issue Dec 14, 2018 · 2 comments

Comments

@hebaoying
Copy link

hebaoying commented Dec 14, 2018

1,描述你需要完成的需求以及目的(目的就是为什么要做这个需求)

想在服务器上跑,不想在自己本机上跑

2,描述你的想法或思路
在服务器项目使用npm install smsboomer -g安装,然后直接 run

3,描述具体的实现过程
实现过程如上,遇到问题,貌似是pupeteer安装遇到问题,然后又安装了 pupeteer,还是报同样的错误。

4,描述遇到的问题,包括正确信息,报错信息或得到的不正确的信息
在服务器项目npm install smsboomer -g的报错:

➜  forGrandma git:(master) ✗ npm install smsboomer -g
/usr/bin/smsboomer -> /usr/lib/node_modules/smsboomer/bin/smsboomer

> [email protected] install /usr/lib/node_modules/smsboomer/node_modules/puppeteer
> node install.js

fs.js:902
  return binding.mkdir(pathModule.toNamespacedPath(path),
                 ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/smsboomer/node_modules/puppeteer/.local-chromium'
    at Object.fs.mkdirSync (fs.js:902:18)
    at Object.downloadRevision (/usr/lib/node_modules/smsboomer/node_modules/puppeteer/utils/ChromiumDownloader.js:101:10)
    at Object.<anonymous> (/usr/lib/node_modules/smsboomer/node_modules/puppeteer/install.js:50:12)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install 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!     /root/.npm/_logs/2018-12-14T10_40_02_987Z-debug.log

没有权限修改文件夹,我又修改了文件夹权限
chmod -R 777 /usr/lib/node_modules
再次安装还是得到一样的报错。

然后尝试先安装 pupeteer,
yarn add puppeteer -D
pupetter安装倒是成功的。

我还更新了 npm,还是不行。

5,有条件则贴出具体实现代码

实现代码如上

@welcome
Copy link

welcome bot commented Dec 14, 2018

Thanks for opening your first issue here! Be sure to follow the issue template!

@hebaoying hebaoying changed the title 怎样在服务器ubuntu 怎样在服务器ubuntu 16.4上运行 Dec 14, 2018
@kenvifire
Copy link

权限问题,npm -g需要sudo权限

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants