osmlint icon indicating copy to clipboard operation
osmlint copied to clipboard

installation error at sqlite3

Open answerquest opened this issue 6 years ago • 6 comments

# npm install -g osmlint
/root/.nvm/versions/node/v9.11.1/bin/osmlint -> /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/cli.js

> [email protected] install /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

sh: 1: node-pre-gyp: Permission denied
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-14T13_51_41_320Z-debug.log

The depub log mentioned can be seen here: https://server.nikhilvj.co.in/dump/2019-09-14T13_51_41_320Z-debug.log

I rolled back to node version 9.11.1 after seeing this, but alas no dice. https://github.com/mapbox/node-sqlite3/issues/972

answerquest avatar Sep 14 '19 13:09 answerquest

It finally worked when I tried this: https://github.com/jansmolders86/mediacenterjs/issues/191#issuecomment-317437604

npm config set user 0
npm config set unsafe-perm true

Missing the good old days of standalone applications :P

answerquest avatar Sep 14 '19 14:09 answerquest

I purged nvm/npm/node completely, did fresh reinstall and tried installing this again. Here are some key error lines:

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v72-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v72-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI) (falling back to source compile with node-gyp) 

answerquest avatar Sep 16 '19 02:09 answerquest

Adding link to a previous relevant issue in node-sqlite3 repo: https://github.com/mapbox/node-sqlite3/issues/918

answerquest avatar Sep 16 '19 03:09 answerquest

Got it to work again. Hope this helps others. Before running the install command:

nvm install 9.11.1
npm config set user 0
npm config set unsafe-perm true

Then,

npm install -g osmlint

Some warning messages were displayed, but the script is working. Copying them here for reference.

# npm install -g osmlint
/root/.nvm/versions/node/v9.11.1/bin/osmlint -> /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/cli.js

> [email protected] install /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/sqlite3/lib/binding/node-v59-linux-x64/node_sqlite3.node" is installed via remote

> [email protected] install /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/@mapbox/tile-reduce/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/@mapbox/tile-reduce/node_modules/sqlite3/lib/binding/node-v59-linux-x64/node_sqlite3.node" is installed via remote

> [email protected] install /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/time
> node-gyp rebuild

make: Entering directory '/root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/time/build'
  CXX(target) Release/obj.target/time/src/time.o
In file included from ../../nan/nan.h:192:0,
                 from ../src/time.cc:5:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../../nan/nan_maybe_43_inl.h:112:73: warning: ‘v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’ is deprecated: Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
                                                                         ^
In file included from /root/.node-gyp/9.11.1/include/node/v8.h:26:0,
                 from /root/.node-gyp/9.11.1/include/node/node.h:63,
                 from ../../nan/nan.h:49,
                 from ../src/time.cc:5:
/root/.node-gyp/9.11.1/include/node/v8.h:3165:29: note: declared here
                 Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
                             ^
/root/.node-gyp/9.11.1/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
  SOLINK_MODULE(target) Release/obj.target/time.node
  COPY Release/time.node
make: Leaving directory '/root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/time/build'
+ [email protected]
added 534 packages in 92.608s

answerquest avatar Sep 16 '19 09:09 answerquest

I am not able to get it to work either, even following your instructions.

                                                                                                                                    
> [email protected] install /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/sqlite3                             
> node-pre-gyp install --fallback-to-build                                                                                          
                                                                                                                                    
[sqlite3] Success: "/root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/sqlite3/lib/binding/node-v59-linux-x64/no
de_sqlite3.node" is installed via remote                                                                                            
                                                                                                                                    
> [email protected] install /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/@mapbox/tile-reduce/node_modules/sqli
te3                                                                                                                                 
> node-pre-gyp install --fallback-to-build                                                                                          
                                                                                                                                    
node-pre-gyp WARN Using request for node-pre-gyp https download                                                                     
node-pre-gyp ERR! Completion callback never invoked!                                                                                
node-pre-gyp ERR! System Linux 4.9.184-linuxkit                                                                                     
node-pre-gyp ERR! command "/root/.nvm/versions/node/v9.11.1/bin/node" "/root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/nod
e_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"                                                                        
node-pre-gyp ERR! cwd /root/.nvm/versions/node/v9.11.1/lib/node_modules/osmlint/node_modules/@mapbox/tile-reduce/node_modules/sqlite
3                                                                                                                                   
node-pre-gyp ERR! node -v v9.11.1                                                                                                   
node-pre-gyp ERR! node-pre-gyp -v v0.11.0                                                                                           
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.                                                                                  
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:                                                 
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>                                                               
npm ERR! code ELIFECYCLE                                                                                                            
npm ERR! errno 6                                                                                                                    
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`                                                          
npm ERR! Exit status 6                                                                                                              
npm ERR!                                                                                                                            
npm ERR! Failed at the [email protected] install script.                                                                                
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.                                  
                                                                                                                                    
npm ERR! A complete log of this run can be found in:                                                                                
npm ERR!     /root/.npm/_logs/2019-09-23T17_09_28_817Z-debug.log```

devturner avatar Sep 23 '19 17:09 devturner

Have you tried installing using the source?

git clone https://github.com/osmlab/osmlint.git --depth=1
cd osmlint
npm install
npm link

Rub21 avatar Sep 23 '19 18:09 Rub21