Utilizzando questo comando: npm install jsdom, nel tentativo di ottenere jsdom attivo e in esecuzione da utilizzare con un server node.js, ottengo la seguente serie di errori. Qualcuno potrebbe aiutarmi a chiarire questo problema? Penso che potrebbe esserci anche un problema perché non è possibile installare contextify ... grazie in anticipo!Problema di installazione di JSDOM su mac
npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/htmlparser
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
> [email protected] install /Users/dereklo/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild
gyp ERR! rebuild error Error: not found: make
gyp ERR! rebuild error at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! rebuild error at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! rebuild error at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! rebuild error at Object.oncomplete (fs.js:297:15)
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/jsdom
├── [email protected]
└── [email protected]
Huh, penso che questo ha funzionato, tuttavia sto ancora ricevendo un errore nella mia applicazione che sto cercando di implementare. So che questo è fuori dallo scopo di questa domanda e forse ne chiederò un altro, ma hai idea di cosa significhi questo errore? /Users/dereklo/Node/node_modules/jsdom/lib/jsdom.js:171 features = JSON.parse (JSON.stringify (window.document.implementation._fea ^ TypeError: Impossibile leggere la proprietà 'implementazione' di undefined – Apollo
Prova a eseguire il debug e vedi cosa contiene "window.document", non contiene nulla ("undefined"), perché "window.document" è clientide javascript? Non so esattamente cosa stai provando da fare, ma window.document dovrebbe essere usato @ clientide javascript not node.js. – onlineracoon
@Derek Go scarica e installa Python (http://www.python.org/getit/mac/), dopo l'installazione vai al terminale e digita " python "per vedere se si sta innescando, se non si innesca è necessario aggiungere variabili di ambiente per assicurarsi che funzioni. Riavvia, riprova a compilare il modulo Node.js, finito :) – onlineracoon