tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 527 forks source link

Cannot find module '/path/to/mapnik_settings.js' #2618

Closed chrismp closed 6 years ago

chrismp commented 6 years ago

I recently cloned tilemill to my ~/ directory on Debian 9.3. I went into the tilemill/ directory and ran npm install, which produced the following output.

> tilemill@0.10.2 preinstall /home/chris/tilemill
> npm install npm

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN tilemill@0.10.2 No license field.

+ npm@2.1.18
added 150 packages in 2.588s
npm WARN deprecated sphericalmercator@1.0.5: This module is now under the @mapbox namespace: install @mapbox/sphericalmercator instead
npm WARN deprecated mbtiles@0.8.2: This module has moved: please install @mapbox/mbtiles instead
npm WARN deprecated tilelive@5.12.3: This module has moved: please install @mapbox/tilelive instead
npm WARN deprecated protozero@1.5.1: protozero should no longer be used via npm, install instead via https://github.com/mapbox/mason
npm WARN deprecated tiletype@0.1.0: This module is now under the @mapbox namespace: install @mapbox/tiletype instead
npm WARN deprecated queue-async@1.0.7: renamed to d3-queue
npm WARN deprecated express@2.5.11: express 2.x series is deprecated
npm WARN deprecated connect@1.9.2: connect 1.x series is deprecated

> gdal@0.9.6 install /home/chris/tilemill/node_modules/gdal
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/gdal/v0.9.6/node-v59-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for gdal@0.9.6 and node@9.3.0 (node-v59 ABI) (falling back to source compile with node-gyp) 
module.js:557
    throw err;
    ^

Error: Cannot find module 'internal/util/types'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at evalmachine.<anonymous>:31:26
    at Object.<anonymous> (/home/chris/tilemill/node_modules/npm/node_modules/graceful-fs/fs.js:11:1)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /home/chris/tilemill/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/chris/tilemill/node_modules/gdal/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.9.0-4-amd64
node-pre-gyp ERR! command "/usr/bin/node" "/home/chris/tilemill/node_modules/gdal/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/chris/tilemill/node_modules/gdal
node-pre-gyp ERR! node -v v9.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /home/chris/tilemill/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean' (1)
npm WARN tilemill@0.10.2 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gdal@0.9.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gdal@0.9.6 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!     /home/chris/.npm/_logs/2017-12-26T05_47_01_911Z-debug.log

Partial output from log mentioned above:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using npm@5.5.1
3 info using node@v9.3.0
4 verbose npm-session e984ff6dab9b1915
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall tilemill@0.10.2
7 info lifecycle tilemill@0.10.2~preinstall: tilemill@0.10.2
8 verbose lifecycle tilemill@0.10.2~preinstall: unsafe-perm in lifecycle true
9 verbose lifecycle tilemill@0.10.2~preinstall: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/chris/tilemill/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
10 verbose lifecycle tilemill@0.10.2~preinstall: CWD: /home/chris/tilemill
11 silly lifecycle tilemill@0.10.2~preinstall: Args: [ '-c', 'npm install npm' ]
12 silly lifecycle tilemill@0.10.2~preinstall: Returned: code: 1  signal: null
13 info lifecycle tilemill@0.10.2~preinstall: Failed to exec preinstall script
14 verbose stack Error: tilemill@0.10.2 preinstall: `npm install npm`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
14 verbose stack     at EventEmitter.emit (events.js:159:13)
14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack     at ChildProcess.emit (events.js:159:13)
14 verbose stack     at maybeClose (internal/child_process.js:943:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
15 verbose pkgid tilemill@0.10.2
16 verbose cwd /home/chris/tilemill
17 verbose Linux 4.9.0-4-amd64
18 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
19 verbose node v9.3.0
20 verbose npm  v5.5.1
21 error code ELIFECYCLE
22 error errno 1
23 error tilemill@0.10.2 preinstall: `npm install npm`
23 error Exit status 1
24 error Failed at the tilemill@0.10.2 preinstall script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Then when I run ./index.js, nodejs ./index.js, or node ./index.js, I get this error in the terminal:

module.js:557
    throw err;
    ^

Error: Cannot find module '/home/chris/tilemill/node_modules/mapnik/lib/binding/mapnik_settings.js'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/chris/tilemill/node_modules/mapnik/lib/mapnik.js:8:16)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)

How do I get Tilemill to work on my computer running Debian 9.3?

chrismp commented 6 years ago

Seems that downgrading NodeJS from 9.3 to 6.12.2 worked.