我正在尝试使用netcdf(https://www.npmjs.com/package/netcdf)库在Node.js程序中编码一个NetCDF文件。
现在,一旦我运行了一个程序,我得到了下面的一个错误。
C:\app [master +2 ~1 -0 !]> npm start
> spaceapps@1.0.0 start C:\app
> node server.js
C:\app\node_modules\text-encoding\lib\encoding.js:979
throw TypeError('Called as a function. Did you forget \'new\'?');
^
TypeError: Called as a function. Did you forget 'new'?
at TypeError (native)
at Object.TextDecoder (C:\app\node_modules\text-encoding\lib\encoding.js:979:13)
at Object.<anonymous> (C:\app\node_modules\netcdf\util\readbinary.js:4:40)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (C:\app\node_modules\netcdf\util\type.js:4:14)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v\\nodev5.9.1\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v5.9.1
npm ERR! npm v3.8.7
npm ERR! code ELIFECYCLE
npm ERR! spaceapps@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spaceapps@1.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spaceapps package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs spaceapps
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls spaceapps
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\app\npm-debug.log
C:\app [master +3 ~1 -0 !]>似乎库中有一个错误。如果有人能告诉我一个解决方案,我将不胜感激。
发布于 2016-11-08 00:12:31
正如开发人员所说,他有no plans in the short or medium term to continue development,所以你可以考虑使用netcdfjs,这是一个允许读取NetCDF v3文件的javascript库。因为它是一个NodeJS包,所以您可以在服务器端运行它,对于常规大小的文件,您可以在线阅读它,这里有一个example。
https://stackoverflow.com/questions/36904317
复制相似问题