I'm trying to install graphene-pk11 node js module to interact with SoftHSM2. I'm using node v4.6.0 and npm 2.15.9
If I execute the command npm install graphene-pk11
, I get the error enoent ENOENT: no such file or directory, chmod '/home/lzuniga/development/HsmTest/node_modules/graphene-pk11/build/console/console.js'
, which I looked up on multiple forums and tried a lot of solutions/workarounds like running npm cache clean
or removing the node_modules
folder.
I also downloaded the graphene source from github's repo and tried to use it as stated in neebz and theprogrammer's answers on this question (created a node_modules
folder in my project folder and put graphene source folder there, then on my app.js file I added var graphene = require("graphene-pk11");
), but the error was Cannot find module 'graphene-pk11'
It should be an npm issue, but I don't know if there could be a different problem in this module, since none of the solutions for the enoent error worked for me...
EDIT
If I run npm install
inside the graphene project directory that I downloaded and copied into the node_modules directory, I get the following output:
$ npm install
npm WARN package.json graphene-pk11@2.0.11 No bin file found at ./build/console/console.js
npm WARN deprecated watch@0.19.3: Install watch@1.0.0 instead
> pkcs11js@1.0.3 install /home/lzuniga/development/HsmTest/node_modules/graphene/node_modules/pkcs11js
> node-gyp rebuild
make: Entering directory `/home/lzuniga/development/HsmTest/node_modules/graphene/node_modules/pkcs11js/build'
CXX(target) Release/obj.target/pkcs11/src/main.o
CXX(target) Release/obj.target/pkcs11/src/dl.o
CXX(target) Release/obj.target/pkcs11/src/const.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/error.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/v8_convert.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/template.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/mech.o
../src/pkcs11/mech.cpp: In member function ‘void Mechanism::Free()’:
../src/pkcs11/mech.cpp:121:15: warning: deleting ‘void*’ is undefined [enabled by default]
CXX(target) Release/obj.target/pkcs11/src/pkcs11/param.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_aes.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_rsa.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/param_ecdh.o
CXX(target) Release/obj.target/pkcs11/src/pkcs11/pkcs11.o
CXX(target) Release/obj.target/pkcs11/src/async.o
CXX(target) Release/obj.target/pkcs11/src/node.o
SOLINK_MODULE(target) Release/obj.target/pkcs11.node
COPY Release/pkcs11.node
make: Leaving directory `/home/lzuniga/development/HsmTest/node_modules/graphene/node_modules/pkcs11js/build'
npm WARN engine http-auth@2.4.10: wanted: {"node":">=5"} (current: {"node":"4.6.0","npm":"2.15.9"})
npm WARN engine apache-crypt@1.1.2: wanted: {"node":">=5"} (current: {"node":"4.6.0","npm":"2.15.9"})
npm WARN engine apache-md5@1.0.6: wanted: {"node":">=5"} (current: {"node":"4.6.0","npm":"2.15.9"})
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! path /home/lzuniga/development/HsmTest/node_modules/graphene/build/console/console.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/lzuniga/development/HsmTest/node_modules/graphene/build/console/console.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/lzuniga/development/HsmTest/node_modules/graphene/npm-debug.log