我有一台 Ubuntu 16.04 服务器,上面有一个 Drupal 8.4 网站
我想为我的网站安装 Node.js。
1)我使用 root 身份连接到我的服务器,并在服务器的根目录下输入以下命令:
root@vps000000:~# curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
root@vps000000:~# apt-get install -y nodejs
安装进展顺利。
2)我现在正在安装drupal-node.js:
root@vps000000~# npm install drupal-node.js
问题是我错误地安装了 drupal-node.js 模块。实际上它应该在 drupal 站点文件夹中。
我执行了以下命令来卸载它:
root@vps000000~# npm uninstall drupal-node.js
模块已被卸载,但 node_modules 文件夹和 package-lock.json 文件仍然存在:
root@vps000000:~# ls
dead.letter drupal.phar installer_la_cle.sh node_modules package-lock.json
以下是目录 node_modules 的内容:
root@vps000000:~/node_modules# ls
accepts caseless engine.io hawk media-typer process-nextick-args supports-color
after chalk engine.io-client hoek merge-descriptors proxy-addr to-array
ansi-regex combined-stream engine.io-parser http-errors methods qs tough-cookie
ansi-styles commander escape-html http-signature mime range-parser tunnel-agent
arraybuffer.slice component-bind escape-string-regexp iconv-lite mime-db raw-body tweetnacl
array-flatten component-emitter etag indexof mime-types readable-stream type-is
asn1 component-inherit express inherits ms request ultron
assert-plus content-disposition extend ipaddr.js negotiator safe-buffer unpipe
async content-type extsprintf isarray node-uuid send util-deprecate
aws-sign2 cookie finalhandler is-my-ip-valid oauth-sign serve-static utils-merge
backo2 cookie-signature forever-agent is-my-json-valid object-assign setprototypeof vary
base64-arraybuffer core-util-is form-data is-property object-component sntp verror
base64id cryptiles forwarded isstream on-finished socket.io ws
bcrypt-pbkdf dashdash fresh is-typedarray options socket.io-adapter wtf-8
better-assert debug generate-function jsbn parsejson socket.io-client xmlhttprequest-ssl
bl delayed-stream generate-object-property json3 parseqs socket.io-parser xtend
blob depd getpass jsonpointer parseuri sshpk yeast
body-parser destroy har-validator json-schema parseurl statuses
boom ecc-jsbn has-ansi json-stringify-safe path-to-regexp string_decoder
bytes ee-first has-binary jsprim pinkie stringstream
callsite encodeurl has-cors lodash pinkie-promise strip-ansi
我知道如何在我的 drupal 站点中安装 drupal-node.js。如何从我的根目录中完全卸载它?
他难道就应该这么做吗rm -r
?
答案1
查看标记在这里回答
sudo apt-get remove nodejs
sudo apt-get remove npm
另外在评论中进行一些额外的清理
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/include/node*
sudo rm -rf /usr/local/bin/node*
高血压