Built version of acorn.js?


#1

The Acorn README says about the “Main parser” that “This is implemented in dist/acorn.js”, but there is no such file in the repository dist folder. Do I have to install or build from source to get the acorn.js file I need?


#2

I’ll that with a fresh install of 64-bit node on my Windows 10 machine “npm install acorn” fails in a very strange way:

Microsoft Windows [Version 10.0.14393]
© 2016 Microsoft Corporation. All rights reserved.

C:\Users\Bruce>npm install acorn

canvas@1.6.2 install C:\Users\Bruce\node_modules\canvas
node-gyp rebuild

C:\Users\Bruce\node_modules\canvas>if not defined npm_config_node_gyp (node “C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (no
de “” rebuild )
Warning: Missing input files:
C:\GTK\bin\zlib1.dll
C:\GTK\bin\libexpat-1.dll
C:\GTK\bin\libpng14-14.dll
C:\GTK\bin\libcairo-2.dll
C:\GTK\bin\libfontconfig-1.dll
C:\GTK\bin\libfreetype-6.dll
Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch.
Canvas.cc
CanvasGradient.cc
CanvasPattern.cc
CanvasRenderingContext2d.cc
color.cc
Image.cc
ImageData.cc
init.cc
win_delay_load_hook.cc
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\Image.cc) [C:\Users\Bruce\node_mod
ules\canvas\build\canvas.vcxproj]
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\ImageData.cc) [C:\Users\Bruce\node
_modules\canvas\build\canvas.vcxproj]
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\Canvas.cc) [C:\Users\Bruce\node_mo
dules\canvas\build\canvas.vcxproj]
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\CanvasPattern.cc) [C:\Users\Bruce
node_modules\canvas\build\canvas.vcxproj]
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\CanvasGradient.cc) [C:\Users\Bruce
\node_modules\canvas\build\canvas.vcxproj]
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\init.cc) [C:\Users\Bruce\node_modu
les\canvas\build\canvas.vcxproj]
c:\users\bruce\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: ‘cairo.h’: No such file or directory (compiling source file …\src\CanvasRenderingContext2d.cc) [C:\U
sers\Bruce\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” "rebuild"
gyp ERR! cwd C:\Users\Bruce\node_modules\canvas
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
C:\Users\Bruce
`-- acorn@4.0.3

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Bruce\package.json’
npm WARN Bruce No description
npm WARN Bruce No repository field.
npm WARN Bruce No README data
npm WARN Bruce No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.2 (node_modules\canvas):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.2 install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

C:\Users\Bruce>


#3

Acorn doesn’t have any dependencies, so whatever is triggering the install of canvas, it doesn’t have anything to do with acorn. Could it be that the dir you’re in has a package.json that lists other stuff?


#4

Thanks for the tip. When I executed “npm intall acorn” in an empty directory there was no problem.