У меня есть сервер 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-node.js на моем сайте drupal. Как удалить его полностью из моего корневого каталога?
Должен ли он просто сделать это 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*
НТН