Vue-cli: Cannot install @vue/cli-service on Linux aarch64 because "Failed at the [email protected] install script."

Created on 18 Feb 2019  Â·  11Comments  Â·  Source: vuejs/vue-cli

Version

3.4.0

Environment info

OS: Linux 4.14.0-xilinx-v2018.2 aarch64 / arm64
User: root
Node: 10.15.1 (installed at /usr/bin/node)
npm: 6.4.1 (installed at /usr/bin/npm)

Steps to reproduce

From the command line, just do npm install @vue/cli-service.

What is expected?

The installation of @vue/cli-service is successful.

What is actually happening?

The installation fails with the following error message:

> [email protected] install /home/root/apps/config-manager/out/webapp/frontend/node_modules/yorkie
> node bin/install.js

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module '/home/root/apps/config-manager/out/webapp/frontend/node_modules/yorkie/bin/install.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node bin/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.

When inspecting the NPM debug logs:

22191 verbose stack Error: [email protected] install: `node bin/install.js`
22191 verbose stack Exit status 1
22191 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/nodejs/node-v10.15.1-linux-arm64/lib/node_modules/np
m/node_modules/npm-lifecycle/index.js:301:16)
22191 verbose stack     at EventEmitter.emit (events.js:189:13)
22191 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/nodejs/node-v10.15.1-linux-arm64/lib/node_modules/np
m/node_modules/npm-lifecycle/lib/spawn.js:55:14)
22191 verbose stack     at ChildProcess.emit (events.js:189:13)
22191 verbose stack     at maybeClose (internal/child_process.js:970:16)
22191 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
22192 verbose pkgid [email protected]
22193 verbose cwd /home/root/apps/config-manager/out/webapp/frontend
22194 verbose Linux 4.14.0-xilinx-v2018.2
22195 verbose argv "/usr/local/lib/nodejs/node-v10.15.1-linux-arm64/bin/node" "/usr/bin/npm" "install" "@vue/cli-service
"
22196 verbose node v10.15.1
22197 verbose npm  v6.4.1
22198 error code ELIFECYCLE
22199 error errno 1
22200 error [email protected] install: `node bin/install.js`
22200 error Exit status 1
22201 error Failed at the [email protected] install script.

The same error is encountered when doing:

  • npm install @vue/cli
  • npm install yorkie

Most helpful comment

For security reasons, if you run npm install as root, npm will set the user to "nobody" when running postinstall scripts, which does not have access to the project directory, thus the error message.

All 11 comments

I know that there is a similar issue posted at https://github.com/vuejs/vue-cli/issues/3056 ("_Yorkie installation fails which causes Vue CLI to fail_") but that was closed without any comments or solution, so I posted a new one here as indicated at https://new-issue.vuejs.org/?repo=vuejs/vue-cli ("_open a new issue using the form below instead of commenting on the old issue_").

Have you tried installing vue-cli globally as described here:

npm install -g @vue/cli
# OR
yarn global add @vue/cli

@caugner

I got the same error when I installed @vue/cli and @vue/cli-service globally.

I did some more testing:

I got it to install successfully when I downgraded my env's node version to v8.4.0.
(It's the base node package that comes with the OS.)
But Vue CLI will not run on this lower version:

You are using Node v8.4.0, but this version of vue-cli requires Node >=8.9.
Please upgrade your Node version.

This is mentioned in the Vue Installation docs, where it says "_Vue CLI requires Node.js version 8.9 or above (8.11.0+ recommended)._". But if I upgrade node, I'll get the same installation errors as I previously reported.

I'm not familiar with what's inside Vue CLI or with yorkie, but it seems I'm unable to use it on this env.

What about npm install @vue/cli-service --unsafe-perm?

For security reasons, if you run npm install as root, npm will set the user to "nobody" when running postinstall scripts, which does not have access to the project directory, thus the error message.

Thanks for the tip @sodatea.
It looks like I got it to install successfully now.

  1. I started off with the base node version v8.4.0.
  2. I then updated to the ARMv8 version of node v10.15.1
  3. npm install @vue/cli --unsafe-perm (also works with -g)
  4. npm install @vue/cli-service --unsafe-perm (also works with -g)

Solved issue by using latest node image for container FROM node:latest

This error ([email protected]) is related to the security attributes of the project-vuejs folder. So, create your projects outside the root / folder, make Linux updates (Ubuntu ...) and success to everyone!

@Cebape

So, create your projects outside the root / folder, make Linux updates (Ubuntu ...)

Can you clarify what you mean by "outside the root / folder"?
This is Linux, everything is under /.

Hi! 
I suggest not creating projects inside the /root folder to avoid setting access permissions for your objects, unless this is a requirement for your development environment. For example, create a project folder inside the /home directory as /my-project and inside it create the vuejs project and execute it. If you are using an IDE editor such as Visual Studio Code (or Atom) to open and modify the project folder, you may need to give permissions to it (chmod). I successfully tested the host machine, VM and Docker-CE container (all with Ubuntu 18.04 and Vue-CLI 4.2.3).
Em sexta-feira, 3 de abril de 2020 09:06:18 BRT, Gino Mempin notifications@github.com escreveu:

So, create your projects outside the root / folder, make Linux updates (Ubuntu ...)

Can you clarify what you mean by "outside the root / folder"?
This is Linux, everything is under /.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings