1. 程式人生 > >centos7.2安裝nodejs、npm走過的坑

centos7.2安裝nodejs、npm走過的坑

 我的環境是win7上裝的Oracle VM VirtualBox  

linux系統是centos7.2

安裝

wget -c https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz
xz -d node-v10.9.0-linux-x64.tar.xz
tar -xvf node-v10.9.0-linux-x64.tar
mv node-v10.9.0-linux-x64 /usr/local/
ln -s /usr/local/node-v10.9.0-linux-x64/bin/node /usr/local/bin/node
ln -s /usr/local/node-v10.9.0-linux-x64/bin/npm /usr/local/bin/npm
node -v
npm -v
cd /data/httpd/kangaroo_mini_app
npm cache clean --force
npm i

接二連三的warning、error  。。。

1、npm ERR! rofs EROFS: read-only file system, symlink '../eslint/bin/eslint.js' ->

解決方法:Enable symlinks

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1
Or on Windows

VBoxManage.exe setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1
where VM_NAME is the name of your virtual machine (e.g Ubuntu) and SHARE_NAME the name of your shared directory (without the "sf_" prefix).

This will re-enable the previous symlink friendly behavior.

Note: On Windows, always restart the Virtual Machine AND VirtualBox GUI.

我的是win7上的虛擬機器

cmd以管理員身份開啟

D:\Program Files\Oracle\VirtualBox>VBoxManage.exe setextradata centos64 VBoxInternal2/SharedFoldersEnableSymlinksCreate/share 1

其中:centos64是虛擬機器名稱 share是共享資料夾的名稱

2、npm ERR! Error: EPERM: operation not permitted, rename

npm ERR! Error: EPERM: operation not permitted, rename '/data/httpd/kangaroo_mini_app/node_modules/.staging/abbrev-08eaebb8' -> '/data/httpd/kangaroo_mini_app/node_modules/abbrev'
npm ERR!     at destStatted (/usr/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
npm ERR!     at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/polyfills.js:264:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! 
npm ERR! Error: EPERM: operation not permitted, rename '/data/httpd/kangaroo_mini_app/node_modules/.staging/abbrev-08eaebb8' -> '/data/httpd/kangaroo_mini_app/node_modules/abbrev'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, rename '/data/httpd/kangaroo_mini_app/node_modules/.staging/abbrev-08eaebb8' -> '/data/httpd/kangaroo_mini_app/node_modules/abbrev'
npm ERR!     at destStatted (/usr/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
npm ERR!     at /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs/polyfills.js:264:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! 
npm ERR! Error: EPERM: operation not permitted, rename '/data/httpd/kangaroo_mini_app/node_modules/.staging/abbrev-08eaebb8' -> '/data/httpd/kangaroo_mini_app/node_modules/abbrev'
npm ERR!     at Error (native) parent: 'kangaroo' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /data/httpd/kangaroo_mini_app/npm-debug.log

解決方法:關掉win7環境的360

後來再執行安裝

3、npm ERR! ETXTBSY: text file is busy, rename

npm cache clean --force
npm i
#不行 還是報錯 npm ERR! ETXTBSY: text file is busy, rename
npm cache clean --force
npm rebuild node-sass --no-bin-links
npm install --no-bin-links
#不行 還是報錯 npm ERR! ETXTBSY: text file is busy, rename
npm install -f

還是報錯

失望了   改裝yarn了

npm cache clean --force
npm install -g yarn
ln -s /usr/local/node-v10.9.0-linux-x64/bin/yarn /usr/local/bin/yarn
[[email protected] kangaroo_mini_app]# yarn install
yarn install v1.9.4
warning package.json: No license field
info No lockfile found.
warning [email protected]: No license field
[1/4] Resolving packages...
warning stylelint > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning wepy-plugin-imagemin > imagemin-pngquant > pngquant-bin > bin-wrapper > download > gulp-decompress > [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "[email protected]>=2.0.0 < 3.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 538.95s.
[[email protected] kangaroo_mini_app]#yarn run dev
yarn run v1.9.4
warning package.json: No license field
$ run-p start watch:font
warning package.json: No license field
warning package.json: No license field
$ onchange 'icons/*.svg' -- npm run font-build
$ wepy build --watch
/bin/sh: wepy: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with signal "SIGTERM".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "start" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[[email protected] kangaroo_mini_app]# npm install wepy-cli -g
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
/usr/local/node-v10.9.0-linux-x64/bin/wepy -> /usr/local/node-v10.9.0-linux-x64/lib/node_modules/wepy-cli/bin/wepy.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wepy-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 462 packages from 296 contributors in 41.131s
[[email protected] kangaroo_mini_app]# yarn run dev
yarn run v1.9.4
warning package.json: No license field
$ run-p start watch:font
warning package.json: No license field
warning package.json: No license field
$ wepy build --watch
$ onchange 'icons/*.svg' -- npm run font-build
[05:46:49] [編譯] 入口: src/app.wpy

到此可以了

其他情況:

yarn add webpack webpack-cli --save-dev

yarn add v1.9.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../acorn/bin/acorn' -> '/data/httpd/webpack-demo/node_modules/acorn-dynamic-import/node_modules/.bin/acorn'".
info If you think this is a bug, please open a bug report with the information provided in "/data/httpd/webpack-demo/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

改為:yarn add webpack webpack-cli --save-dev --no-bin-links 

2018.10.17 15:00:00

error An unexpected error occurred: "EPROTO: protocol error, symlink '../jsesc/bin/jsesc' -> '/data/httpd/ec

If you don't want to run virtualbox as administrator, you can allow creating symbolic links for all users:

  1. Open the Local Group Policy Editor (gpedit.msc)
  2. Edit the Create symbolic links policy at:

Computer configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment → Create symbolic links

便按照此嘗試了下  發現成功解決了這個問題  不用再要加上--no-bin-links了

選擇一個  確定 、然後點選應用、 確定即可

相關推薦

centos7.2安裝nodejsnpm走過

 我的環境是win7上裝的Oracle VM VirtualBox   linux系統是centos7.2 安裝 wget -c https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz xz -d no

安裝NodejsnpmLess

pro 說明 clas 命令行 成功 變量 -c files 2.0 安裝Nodejs和npm 1.到https://nodejs.org/en/下載最新的版本,安裝到c盤下,假設安裝後的路徑為c:\Program Files\nodejs,筆者當前的版本v8.12.0,已

Angularjs學習---angularjs環境搭建,ubuntu 12.04下安裝nodejsnpm和karma

1.下載angularjs 2.示例1 HelloWorld ! 新建一個helloworld.html <!doctype html> <html ng-app> <head> <script src><

NodeJsNPM安裝配置步驟(windows版本)

高效 node 管理 tar 學習 node.js tps .com 系統 Node.js 是一個基於 Chrome V8 引擎的 JavaScript 運行環境。Node.js 使用了一個事件驅動、非阻塞式 I/O 的模型,使其輕量又高效。 Node.

centos7 同時安裝python2python3和pip3以及各種包遇到的

PHP交流群:294088839 大Python交流群:652376983   第一個坑:pip3的安裝 不知道為什麼裝完python3之後,並沒有pip3這個命令,因此我需要重新安裝pip3,對於網上其他的直接安裝pip3教程,並沒有成功。所以我的選擇是,下載安裝包,自己

1centos7.2安裝keepalived實測版

0、Keepalived介紹  Keepalived是一個基於VRRP協議來實現的服務高可用方案,可以利用其來避免IP單點故障,類似的工具還有heartbeat、corosync、pacemaker。但是它一般不會單獨出現,而是與其它負載均衡技術(如lvs、haproxy、nginx)一起工作來達到叢集的高可

OpenStack-M版(Mitaka)搭建基於(Centos7.2)+++十Openstack物件儲存服務(swift)完成安裝

十、Openstack物件儲存服務(swift)完成安裝 一、啟動服務 1.在控制節點節點上,啟動物件儲存代理服務及其依賴服務,並將它們配置為隨系統啟動 systemctl enable opens

NodeJSNPM安裝配置步驟

1、windows下的NodeJS安裝是比較方便的(v0.6.0版本之後,支援windows native),只需要登陸官網(http://nodejs.org/),便可以看到下載頁面。 2、下載完成後雙擊執行進行安裝,安裝過程基本直接“NEXT”就可以了

NodeJSNPM安裝配置步驟(windows7 64位)

2、安裝過程基本直接“NEXT”就可以了。(windows的安裝msi檔案在過程中會直接新增path的系統變數,變數值是你的安裝路徑,例如“C:\Program Files\nodejs”)。 3、安裝完成後可以使用cmd(win+r然後輸入cmd進入)測試下是否安裝成功。方法:在cmd下輸入node

NodeJSnpm安裝配置,指定npm安裝目錄,可移植的node以及模組

1、首先我們要到nodejs官網(https://nodejs.org)上下載node,選擇一個自己喜歡的版本下載。我這裡選擇的是最新版 2、下載完了就直接雙擊安裝,安裝過程中可以另外指定安裝路徑,我的安裝路徑是E:\FRONT\nodejs 3、安裝完

CentOS7.2安裝oracle 12c RAC

linux oracle一、基礎結構:二、存儲規劃: 1、 GRID集群組件磁盤組+dggrid: 1個,由三個10G磁盤組成normal 2、 數據庫安裝磁盤組+dgsystem:用於數據庫基本表空間,控制文件,參數文件等+dgrecovery:用於歸檔與閃回日誌空間+dgdata:用戶數據

centos7.2安裝mysql5.7.17

修改密碼 password 安全性 mysql start CentOS 7之後的版本yum的默認源中使用MariaDB替代原先MySQL,因此安裝方式較為以往有一些改變:下載mysql的源wget http://dev.mysql.com/get/mysql57-community-re

centos7.2 安裝svn服務

centos7 安裝svn服務簡介Subversion(SVN) 是一個開源的版本控制系統, 也就是說 Subversion 管理著隨時間改變的數據。這些數據放置在一個中央資料檔案庫(repository) 中。這個檔案庫很像一個普通的文件服務器, 不過它會記住每一次文件的變動。這樣你就可以把檔案恢復到舊的版

MySql之centos7.2安裝mysql5.7.13

duyuheng mysql centos7.2安裝mysql5.7.13MySql之centos7.2安裝mysql5.7.13一、MySQL 5.7主要特性:原生支持Systemd更好的性能:對於多核CPU、固態硬盤、鎖有著更好的優化更好的InnoDB存儲引擎更為健壯的復制功能:復制帶來了數據完全不丟失

Centos7.2安裝zabbix3.24

fig string .tar.gz httpd evel 用戶與組 數據導入 useradd ml2 zabbix安裝簡要 一、依賴環境yum -y install gcc* make php php-gd php-mysql php-bcmath php-mbstrin

Centos7.2安裝zabbix3.0

centos7.2 zabbix3.0 Centos7.2YUM安裝zabbix3.0防火墻和selinux關閉,這個我就不說了。1.啟動apacheyum -y install httpdsystemctl start httpd.servicesystemctl enable httpd.ser

CentOS7.2安裝mariadb-server,解決Failed to start mysqld.service: Unit not found

serve bsp 開機啟動 輸入 enable -s emctl b-s art 當輸入命令 ~]# systemctl start mysql.service 要啟動MySQL數據庫是卻是這樣的提示 Failed to start mysqld.service: Uni

Centos6.9安裝Node.js+npm

org node.js node libs .tar.xz linu eva 報錯 .tar.gz Node.js選擇 1.下載 wget https://nodejs.org/dist/v8.4.0/node-v8.4.0-linux-x86.tar.gz 2.解壓

CentOS7 編譯安裝nodejs,配置環境變量記錄

ever lis detail 遇到 ++ help 設置 代碼 contains 每次都裝,每次都查 阿裏雲備案了一個域名,續費了好多年,但是沒錢買服務器,就掛在github上。今天收到消息:域名解析服務器不在阿裏雲,要被GG。只能咬牙買了個阿裏雲乞丐版。 所有服務都裝

CentOS7.2安裝VNC,讓Windows遠程連接CentOS 7.2 圖形化界面

ber netstat png grep control 圖片 pin wan cto 需求及說明 開發老大突然心血來潮,讓實現在windows下通過vnc實現連接到CentOS系統的圖形化界面,這裏實踐CentOS7.2下安裝VNC,讓Windows遠程桌