truffle-hdwallet-provider
                                
                                
                                
                                    truffle-hdwallet-provider copied to clipboard
                            
                            
                            
                        npm install truffle-hdwallet-provider
OS: Windows 10
$ node -v && npm -v v10.11.0 6.4.1
$ npm install truffle-hdwallet-provider
[email protected] preinstall C:\Users\ythal\learning\udacity\blockchain\udacity_blockchain_developer_5\smart_contracts_erc721_open_zeppelin\node_modules\scrypt node node-scrypt-preinstall.js
[email protected] install C:\Users\ythal\learning\udacity\blockchain\udacity_blockchain_developer_5\smart_contracts_erc721_open_zeppelin\node_modules\scrypt node-gyp rebuild
C:\Users\ythal\learning\udacity\blockchain\udacity_blockchain_developer_5\smart_contracts_erc721_open_zeppelin\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Users\ythal\nvm\v10.11.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\ythal\nvm\v10.11.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\ythal\nvm\v10.11.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
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! C:\Users\ythal\AppData\Roaming\npm-cache_logs\2018-10-28T19_11_53_119Z-debug.log
Same error here...Have you fixed this?
same problem.
Hi guys after facing many issues I finally could run truffle migrate in my production environment following these steps below:
- run cmd install with admin rights
 - npm install -g truffle
 - npm install -g windows-build-tools
 - npm install -g node-gyp
 - set npm_config_node_gyp=%appdata%\npm\node_modules\node-gyp\bin\node-gyp.js
 - md your_project_name
 - cd your_project_name
 - npm init -y
 - npm install truffle-hdwallet-provider -s
 - truffle init
 - code your solidity contract
 - configure your 2_deploy_contract.js file
 - configure your truffle-config.js file including the section:
production: { provider: () => new HDWalletProvider(mnemonic,your rpc endpoint), network_id: 10101010, // This network is yours, in the cloud. gasPrice: 0 // it´s necessary to allow deploy contracts on a PoA network } - uncomment these lines in the top of config file const HDWalletProvider = require('truffle-hdwallet-provider'); const fs = require('fs'); const mnemonic = fs.readFileSync(".secret").toString().trim();
 - Create a .secret file in your root project directory including your wallet mnemonic
 - truffle compile
 - truffle migrate --network production
 
Hope it helps you guys!
This is not a safe fix. But if only for testing purposes, add --unsafe-perm=true --allow-root to the install command.
I had this problem. What worked was replacing the "truffle-hdwallet-provider" in the require method argument at here: const HDWalletProvider = require('truffle-hdwallet-provider');
with '@truffle/hdwallet-provider'
const HDWalletProvider = require('@truffle/hdwallet-provider');
and truffle compile finally worked
truffle-hd-wallet provider has been deprecated: https://www.npmjs.com/package/truffle-hdwallet-provider
Instead use @truffle/hdwallet-provider: https://www.npmjs.com/package/@truffle/hdwallet-provider
After this @truffle/hdwallet-provider will be successfully installed - then reference in required file as follows:
var HDWalletProvider = require("@truffle/hdwallet-provider");
got the source from: https://ethereum.stackexchange.com/questions/62574/error-cannot-find-module-truffle-hdwallet-provider/82503#82503?newreg=f0f7e403a22046ffb314939227ce9746