Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 884 Bytes

Q-A.md

File metadata and controls

35 lines (23 loc) · 884 Bytes

Q&A

TypeError: Cannot convert object to primitive value

当 object 不是字符串时

console.log("string" + object);

改成

console.log(object);

文件路径

只有在 require() 时才使用相对路径(./, ../) 的写法,其他地方一律使用绝对路径,如下:

// 当前目录下
path.dirname(__filename) + '/test.js';
// 相邻目录下
path.resolve(__dirname, '../lib/common.js');

Not compatible with your operating system or architecture: fsevents

Since fsevents is an API in OS X allows applications to register for notifications of changes to a given directory tree. Running:

npm install --no-optional