NodeJS Cannot find module 'footer' Ubuntu 14.04

wvyml7n5  于 2023-04-11  发布在  Node.js
关注(0)|答案(4)|浏览(145)

我正在使用node-red,我从这个github下载的一些包遇到了一些问题。我已经按照说明获取npm并安装它,但我的系统中缺少库,有人遇到过同样的问题吗?
先谢谢你了!

lo@lo-desktop:~$ sudo npm install crypto-js
npm http GET https://registry.npmjs.org/crypto-js
npm http 200 https://registry.npmjs.org/crypto-js
npm http GET https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.6.tgz
npm http 200 https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.6.tgz
crypto-js@3.1.6 node_modules/crypto-js

locate crypto-js
/home/lo/node_modules/crypto-js
/home/lo/node_modules/crypto-js/CONTRIBUTING.md
/home/lo/node_modules/crypto-js/LICENSE
/home/lo/node_modules/crypto-js/README.md
/home/lo/node_modules/crypto-js/aes.js
/home/lo/node_modules/crypto-js/bower.json
/home/lo/node_modules/crypto-js/cipher-core.js
/home/lo/node_modules/crypto-js/core.js
/home/lo/node_modules/crypto-js/crypto-js.js
/home/lo/node_modules/crypto-js/docs
/home/lo/node_modules/crypto-js/enc-base64.js
/home/lo/node_modules/crypto-js/enc-hex.js
/home/lo/node_modules/crypto-js/enc-latin1.js
/home/lo/node_modules/crypto-js/enc-utf16.js
/home/lo/node_modules/crypto-js/enc-utf8.js
/home/lo/node_modules/crypto-js/evpkdf.js
/home/lo/node_modules/crypto-js/format-hex.js
/home/lo/node_modules/crypto-js/format-openssl.js
/home/lo/node_modules/crypto-js/hmac-md5.js
/home/lo/node_modules/crypto-js/hmac-ripemd160.js
/home/lo/node_modules/crypto-js/hmac-sha1.js
/home/lo/node_modules/crypto-js/hmac-sha224.js
/home/lo/node_modules/crypto-js/hmac-sha256.js
/home/lo/node_modules/crypto-js/hmac-sha3.js
/home/lo/node_modules/crypto-js/hmac-sha384.js
/home/lo/node_modules/crypto-js/hmac-sha512.js
/home/lo/node_modules/crypto-js/hmac.js
/home/lo/node_modules/crypto-js/index.js
/home/lo/node_modules/crypto-js/lib-typedarrays.js
/home/lo/node_modules/crypto-js/md5.js
/home/lo/node_modules/crypto-js/mode-cfb.js
/home/lo/node_modules/crypto-js/mode-ctr-gladman.js
/home/lo/node_modules/crypto-js/mode-ctr.js
/home/lo/node_modules/crypto-js/mode-ecb.js
/home/lo/node_modules/crypto-js/mode-ofb.js
/home/lo/node_modules/crypto-js/package.json
/home/lo/node_modules/crypto-js/pad-ansix923.js
/home/lo/node_modules/crypto-js/pad-iso10126.js
/home/lo/node_modules/crypto-js/pad-iso97971.js
/home/lo/node_modules/crypto-js/pad-nopadding.js
/home/lo/node_modules/crypto-js/pad-pkcs7.js
/home/lo/node_modules/crypto-js/pad-zeropadding.js
/home/lo/node_modules/crypto-js/pbkdf2.js
/home/lo/node_modules/crypto-js/rabbit-legacy.js
/home/lo/node_modules/crypto-js/rabbit.js
/home/lo/node_modules/crypto-js/rc4.js
/home/lo/node_modules/crypto-js/ripemd160.js
/home/lo/node_modules/crypto-js/sha1.js
/home/lo/node_modules/crypto-js/sha224.js
/home/lo/node_modules/crypto-js/sha256.js
/home/lo/node_modules/crypto-js/sha3.js
/home/lo/node_modules/crypto-js/sha384.js
/home/lo/node_modules/crypto-js/sha512.js
/home/lo/node_modules/crypto-js/tripledes.js
/home/lo/node_modules/crypto-js/x64-core.js
/home/lo/node_modules/crypto-js/docs/QuickStartGuide.wiki


lo@lo-desktop:~$ node-red -v
Welcome to Node-RED
===================

12 Apr 09:11:41 - [info] Node-RED version: v0.13.4
12 Apr 09:11:41 - [info] Node.js  version: v0.10.25
12 Apr 09:11:41 - [info] Linux 4.2.0-27-generic ia32 LE
12 Apr 09:11:41 - [info] Loading palette nodes
12 Apr 09:11:43 - [warn] ------------------------------------------
12 Apr 09:11:43 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
12 Apr 09:11:43 - [warn] [TTN] Error: Cannot find module 'crypto-js'
12 Apr 09:11:43 - [warn] ------------------------------------------
12 Apr 09:11:43 - [info] Settings file  : /home/lo/.node-red/settings.js
12 Apr 09:11:43 - [info] User directory : /home/lo/.node-red
12 Apr 09:11:43 - [info] Flows file : /home/lo/.node-red/flows_loshora-desktop.json
12 Apr 09:11:43 - [info] Server now running at http://127.0.0.1:1880/
12 Apr 09:11:43 - [info] Starting flows
12 Apr 09:11:43 - [info] Started flows
vsdwdz23

vsdwdz231#

这看起来像是你在错误的目录中运行了npm install crypto-js。你的项目是否位于/home/lo/?
你有三种可能:
1.运行“sudo npm install -g crypto-js”,使其在您的机器上对所有项目全局可用
1.在项目的根目录下运行“sudo npm install crypto-js”

  • (最好的选择)把你的依赖放到package.json(NPM的配置文件)中,然后在项目的根目录下运行“sudo npm install”
  • 这将安装package.json中的所有依赖项
oaxa6hgo

oaxa6hgo2#

你应该在那个node-red-ttn文件夹里面npm install crypto-js;或全球范围内。

vh0rcniy

vh0rcniy3#

是使用 typescript 和没有工作,直到我跑

$ npm i --save-dev @types/crypto-js
bmp9r5qi

bmp9r5qi4#

这对我来说是有效的,但在你的项目目录中这样写:

npm install crypto-js

相关问题