1. Q&A

1.1. TypeError: Cannot convert object to primitive value

当 object 不是字符串时

console.log("string" + object);

改成

console.log(object);

1.2. 文件路径

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

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

1.3. 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

results matching ""

    No results matching ""