Giter VIP home page Giter VIP logo

nodejs-guidelines's Introduction

Microsoft + Node.js Guidelines

Microsoft ❤️ Node.js!

We work hard to contribute to the Node.js community and we want to make sure your experience is as seamless as possible. In particular, our goals here are to:

  • make it easier for people using Microsoft services and technologies to get started on the right foot with Node.js
  • consolidate Microsoft's Node.js offerings in a centralized place to make it easier for you to find information
  • communicate status on key issues we're addressing and collect feedback from the Node.js community on how we can do better.
  • provide a forum to connect with various teams at Microsoft working on improving the Node.js experience.

Note that this is not intended to be a comprehensive set of recommendations. Rather it's meant to be a helpful set of content that makes it easier to avoid any potential gotchas, and the beginning of what we expect to be an ongoing conversation on how we can improve the Node.js experience on Microsoft platforms.

Emoji legend

💡 This is a tip that provides the reader with some additional info that's not necessary, but potentially useful for the task at hand.

🚩 TODO This describes a todo item that we'd like some help with.

📈 IN PROGRESS This provides awareness about an important issue that we're currently working on resolving.

Getting Started with Node.js

Node.js + Microsoft products, services, and contributions

🚩 TODO Add other Microsoft services related to Node.js.

General Node.js tips, tricks, resources, and more!

Contributions Welcome!

This is still a work in progress, an experiment - if you will, and we'd love your help to make it better! Please see our contributing guidelines for details.

nodejs-guidelines's People

Contributors

aurieh avatar awayken avatar bdukes avatar bertyhell avatar bzoz avatar darshkpatel avatar egamma avatar felixonmars avatar felixrieseberg avatar gangsthub avatar impact123 avatar ivantm avatar joaocgreis avatar m90 avatar microsoft-github-policy-service[bot] avatar mjbvz avatar mousetraps avatar nikunj2102 avatar ripper234 avatar ritazh avatar smauer avatar stevealee avatar thefourtheye avatar towc avatar tracker1 avatar trstringer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-guidelines's Issues

Command line pain points

IN PROGRESS We're currently planning the next Windows release, so it's a great time to let us know your biggest command line pain points!

I find the bash shell in Git 4 Windows and ConEmu works really well for me and removes many of the issues with cmd window resize, text selection, cut and paste, fonts, Unicode support and terminal emulation for colours. Admittedly Win 10 Cmd window is an improvement here. I don't use PowerShell, perhaps I should investigate but I'm pretty set in my ways

So far my number one pain has been installing native modules so it's great you have a section on that here. They often fail and seems to be very sensitive to both the version of VS tooling installed and it's health (repair sometimes helps). Python version can also be a problem if you have it installed for projects.

Another issue is npm assumes windows shell when running package.json scripts. This is a pain if you are using bash but is actually part of the larger issue of writing portable npm scripts. These make a fantastic light weight build facility avoiding the need for make, grunt, gulp, webpack etc. for smaller projects. But they need to be portable.across dev platforms. I nearly added these in a PR here. I investigated this issue and made comprehensive notes in a npm issue but it needs careful engineering.

Underlying this is probably the point many devs create npm packages assuming a *nix dev env and so do not address these few remaining portability pain points when using Windows..

Link-ify table of contents

These links should redirect to their respective headers. There's probably too much churn to do this now, but we should do this as soon as we decide on an initial structure for the content and titles.

Decide on a useful structure

For now, let's focus on content, but let's eventually find a way to restructure our content to be more useful.

MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".

I'd like to figure out how to solve this error and then contribute the solution to the Resolving Common Issues section.

I'm building an addon I've authored myself. (It builds fine on macOS and Linux).

Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "14.0", "4.0".
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:\Users\IEUser\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\IEUser\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\proj\nodebuckets
gyp ERR! node -v v11.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

Here's some diagnostic information. I'm happy to provide anything else you might think helpful:

  • Windows [Version 10.0.15063]
  • npm config list:
    ; cli configs
    metrics-registry = "https://registry.npmjs.org/"
    scope = ""
    user-agent = "npm/6.5.0 node/v11.8.0 win32 ia32"
    
    ; userconfig C:\Users\IEUser\.npmrc
    msvs_version = "2015"
    prefix = "C:\\Users\\IEUser\\AppData\\Roaming\\npm"
    python = "C:\\Users\\IEUser\\.windows-build-tools\\python27\\python.exe"
    
    ; globalconfig C:\Users\IEUser\AppData\Roaming\npm\etc\npmrc
    msvs_version = "2015"
    python = "C:\\Users\\IEUser\\.windows-build-tools\\python27\\python.exe"
    
    ; builtin config undefined
    prefix = "C:\\Users\\IEUser\\AppData\\Roaming\\npm"
    
    ; node bin location = C:\Program Files (x86)\nodejs\node.exe
    ; cwd = C:\Windows\system32
    ; HOME = C:\Users\IEUser
    ; "npm config ls -l" to show all defaults.
    
    
  • yarn config list:
    yarn config v1.13.0
    info yarn config
    { 'version-tag-prefix': 'v',
    'version-git-tag': true,
    'version-commit-hooks': true,
    'version-git-sign': false,
    'version-git-message': 'v%s',
    'init-version': '1.0.0',
    'init-license': 'MIT',
    'save-prefix': '^',
    'bin-links': true,
    'ignore-scripts': false,
    'ignore-optional': false,
    registry: 'https://registry.yarnpkg.com',
    'strict-ssl': true,
    'user-agent': 'yarn/1.13.0 npm/? node/v11.8.0 win32 ia32',
    lastUpdateCheck: 1550698991414,
    msvs_version: '2015',
    'yarn-offline-mirror': '\\\\vboxsrv\\project\\cache\\yarnmirror',
    'yarn-offline-mirror-pruning': false }
    info npm config
    { prefix: 'C:\\Users\\IEUser\\AppData\\Roaming\\npm',
    python: 'C:\\Users\\IEUser\\.windows-build-tools\\python27\\python.exe',
    msvs_version: '2015' }
    
  • Possibly relevant environment variables:
    I see that I've put some garbage values in for Path, but those shouldn't cause the error I'm seeing, right? Is my Path missing anything? Do I have extra things I shouldn't?
    PYTHON=C:\Users\IEUser\.windows-build-tools\python27\python.exe
    Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\OpenSSH\bin;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Git\cmd;C:\mingw32\mingw32\bin;C:\nim\bin;C:\Users\IEUser\.nimble\bin;C:\Users\IEUser\.nimble\bin;C:\Users\IEUser\AppData\Roaming\npm;C:\Windows\system32\node_modules\.bin;"'node' is not recognized as an internal or external command,";"'node' is not recognized as an internal or external command,";node_modules\.bin\;C:\Users\IEUser\AppData\Local\Microsoft\WindowsApps;C:\Users\IEUser\AppData\Local\Yarn\bin
    VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.cpp\v4.0\v140
    VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
    

Windows. Compilation error

Windows 10 x64
Visual Studio 2017 installed, but node-gyp uses vs2015 (from windows-build-tools) and Python27 (from Anaconda).

C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop>npm i

> [email protected] install C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native
> node-gyp rebuild


C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native>if not defined npm_config_node_gyp (node "C:\Users\Igor Igorevich Kim\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Igor Igorevich Kim\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js" rebuild )
  poly1305-donna.c
  chacha20_simple.c
  insecure_memzero.c
  sha256.c
  crypto_scrypt.c
  chacha20.cc
  poly1305.cc
  digest.cc
  cipher.cc
  base58.cc
  bech32.cc
  scrypt.cc
  scrypt_async.cc
..\src\scrypt.cc(20): warning C4244: 'argument': conversion from 'uint64_t' to 'uint32_t', possible loss of data [C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\bcoin-native.vcxproj]
  murmur3.cc
  siphash.cc
  bcn.cc
..\src\scrypt_async.cc(59): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\Igor Igorevich Kim\
Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\bcoin-native.vcxproj]
  C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\nan\nan.h(1618): note: see declaration of 'Nan::Callback::Call' win_delay_load_hook.cc
     Creating library C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\Release\bcoin-native.lib and object C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\Release\bcoin-native.exp
digest.obj : error LNK2001: unresolved external symbol RIPEMD160_Update [C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\bcoin-native.vcxproj]
digest.obj : error LNK2001: unresolved external symbol RIPEMD160_Init [C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\bcoin-native.vcxproj]
digest.obj : error LNK2001: unresolved external symbol RIPEMD160_Final [C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\bcoin-native.vcxproj]
C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\Release\bcoin-native.node :
fatal error LNK1120: 3 unresolved externals [C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native\build\bcoin-native.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Igor Igorevich Kim\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Igor Igorevich Kim\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Igor Igorevich Kim\Desktop\edge-react-gui-develop\node_modules\bcoin-native
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

npm install -g windows-build-tools (Not working in Windows 10 64 bit)

The below is the log from the PowerShell admin user execution.

PS C:\Users\4000> npm -v
6.14.6

PS C:\Users\4000> npm install -g windows-build-tools
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: this library is no longer supported

[email protected] postinstall C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools
node ./dist/index.js

C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\os.js:53
throw resultError;
^

Error: spawnSync powershell.exe ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at Object.spawnSync (child_process.js:616:24)
at spawnSync (C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:67:36)
at Object.queryRegFromPowershell (C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:73:3)
at loop (C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:113:16)
at C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:116:7
at C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:100:5
at spawnSync (C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:68:2)
at Object.queryRegFromRegExe (C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:96:3)
at loop (C:\Users\4000\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:113:16) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawnSync powershell.exe',
path: 'powershell.exe',
spawnargs: [
'-NoProfile',
'-ExecutionPolicy',
'-Command',
'& {(Get-ItemProperty -Path "Registry::HKU\.DEFAULT\Control Panel\International\Geo" -Name Nation).Nation}'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node ./dist/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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! C:\Users\4000\AppData\Roaming\npm-cache_logs\2020-10-06T11_14_52_261Z-debug.log

Licensing is unclear?

Microsoft needs to clarify the licensing in regards to windows-build-tools, if this is an official path pre-requisite for native addon modules for Node.js

Disclaimer: I am not a laywer.

But the following text via the License Terms makes the silent installation unclear, which might mean that all developers wishing to use native addons for Node.js may be violating Microsoft's own license via their own guidelines:

SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. . For more information, see www.microsoft.com/licensing. You may not
work around any technical limitations in the software;
reverse engineer, decompile or disassemble the software, or attempt to do so, except and only to the extent required by third party licensing terms governing use of certain open source components that may be included with the software;
remove, minimize, block or modify any notices of Microsoft or its suppliers;
use the software in any way that is against the law; or
share, publish, rent or lease the software, or provide the software as a stand-alone hosted as solution for others to use.

Specifically around removing/minimizing/blocking the installer notices, etc.?

Refactor "Using nodemon" section

I saw the Using nodemon section, and it strikes me as really opinionated. Or is it supposed to be like this?

I'm curious, why nodemon? Why not pm2, for example? And why not mention other process management tools?

Anyways, I think it would be better to call that section something like Using a process manager or Getting started with node process management or something along those lines.

node-gyp documentation is out of sync with upstream

The part of the Windows Environment documentation referring to supported versions of Python is significantly out of sync with upstream

The mentioned part of the documentation states that Python 2.7 is the only supported version, which is not the case anymore as detailed by upstream. In fact upstream additionally supports any version of Python >= 3.5. Not mention Python 2.7 as EOL as of 2020 and recommending people install end of life software is not a good idea.

Should we cover node as build tool for browser apps?

This may be out of scope but is part of a full stack development capability.

A very common use case of node is acting as a build platform for browsers. Many build tools run in node: grunt, gulp, webpack, though others do not: npm scripts, make.

  1. dependency tracking and re build
  2. hot loading and browsersync
  3. integration with CI and CD tooling - though often done via git hooks

Other node tools provide key functionality such as

  1. Transpiling ES6 to ES5 including source maps for browser dev tools
  2. Preparing assets - catenation, uglification, gzipping
  3. Providing Cross platform CommonJS modules - though this is managed through NPM

tarball.destroy is not a function

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\Acer>cd\

C:>cd demo

C:\demo>npm start

[email protected] prestart C:\demo
npm run build

[email protected] build C:\demo
tsc -p src/

src/app/app.component.ts(4,26): error TS2307: Cannot find module './app.service'
.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "run" "build"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: tsc -p src/
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script 'tsc -p src/'.
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 angular-quickstart pa
ckage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc -p src/
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Acer\AppData\Roaming\npm-cache_logs\2017-07-11T07_54_41_4
41Z-debug.log

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prestart: npm run build
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] prestart script 'npm run build'.

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 angular-quickstart pa
ckage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Acer\AppData\Roaming\npm-cache_logs\2017-07-11T07_54_41_5
34Z-debug.log

Non-MSVC options recommended?

I have poked around the node-gyp project and don't see any easy way to elect an alternate compiler compared to other ecosystems on windows. The terms for the Build Tools require some commercial Visual Studio license which for companies cannot be the Visual Studio Community Edition. So not only do we need to provide a VS Ent/Pro license for the direct team any contributor would need terms as well to allow for the CI runners to be appropriately licensed which is a headwind to inner source.

Windows 10 , Installing Native Modules, Option 1 Complains about missing v110 build tools

On a machine with windows 10 and follow option 1 environment setup method:

  1. nodist v4.2.4
  2. cinst python2
  3. npm config set python python # since python == c:\tools\python2\python.exe
  4. cinst microsoft-build-tools
  5. npm config set msvs_version 2015 --global
  6. npm install bufferutil

Results in :

$ npm i bufferutil

> [email protected] install C:\Users\airtonix\projects\test\node_modules\bufferutil
> node-gyp rebuild


C:\Users\airtonix\projects\test\node_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\Nodist\bin\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(54,5): error MSB8020: The build tools for Visua
l Studio 2012 (Platform Toolset = 'v110') cannot be found. To build using the v110 build tools, please install Visual Studio 2012 bui
ld tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solutio
n, and then selecting "Retarget solution". [C:\Users\airtonix\projects\test\node_modules\bufferutil\build\bufferutil.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 (x86)\Nodist\bin\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files (x86)\\Nodist\\v-x64\\nodev4.2.4\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\airtonix\projects\test\node_modules\bufferutil
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v-x64\\nodev4.2.4\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "i" "bufferutil"
npm ERR! node v4.2.4
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
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 bufferutil package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bufferutil
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bufferutil
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\airtonix\projects\test\npm-debug.log

Add section dedicated to Node.js in Azure

Our offerings for Node.js in Azure are vast, and we should have a dedicated section for working with Node.js in Azure, and cloud-specific actions and knowledge. Thoughts?

call c++ dll by using loadlibrary

Everything works when the environment setup with option I.

And because my dev machine can't connect to Internet, I use option 2 to setup node-gyp, it works ok but loading c++ dll with loadlibray, compile succeed, but run error by returning NULL handle.

are there any configure options should be set in option 2.

Thanks.

Following are the 2 options:

Environment setup and configuration:
•Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools by running npm install -g windows-build-tools from an elevated PowerShell (run as Administrator).
•Option 2: Install dependencies and configuration manually
i.Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio 2017 Community (using the "Desktop development with C++" workload)
ii.Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7
iii.Launch cmd, npm config set msvs_version 2017

Add Test Driven Development Section

This should include leveraging tools like PhantomJS, Sinon, Chai and Karma as part of Azure CI builds. I'll include some sample repo's with workable examples that folks can clone and spin up.

Update `MAX_PATH` guidance for `LongPathsEnabled`?

The MAX_PATH explanation and workarounds guide by @mousetraps seems like a nice set of workarounds and explanation, but seems outdated now (eg. mentions npm v3, doesn't mention LongPathsEnabled)

If LongPathsEnabled is enabled on Windows, is there guidance for getting long paths supported in Node.js as well? Or is there a bug tracking this 260+ characters long paths support in Node.js?

Context:

  1. I am not sure if I'm understanding the details of internal Node.js support of long paths yet, but I do see this comment by @bzoz that "Node uses file namespace paths for file access. We do that so we do not get hit by the 260 path limit," - maybe this only applies to writeFile?
  2. The reason I started all of this is that I'm currently coming from this ESLint bug, which occurs when ESLint tries to import long node_modules paths eslint/eslint#17763

It would be great to get support for long file paths on Windows in Node.js!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.